log4cpp
1.1.6
Toggle main menu visibility
Loading...
Searching...
No Matches
PatternLayout.hh
Go to the documentation of this file.
1
/*
2
* PatternLayout.hh
3
*
4
* Copyright 2002, Bastiaan Bakker. All rights reserved.
5
*
6
* See the COPYING file for the terms of usage and distribution.
7
*/
8
9
#ifndef _LOG4CPP_PATTERNLAYOUT_HH
10
#define _LOG4CPP_PATTERNLAYOUT_HH
11
12
#include <
log4cpp/Configurator.hh
>
13
#include <
log4cpp/Layout.hh
>
14
#include <
log4cpp/Portability.hh
>
15
#include <vector>
16
#ifdef LOG4CPP_HAVE_SSTREAM
17
#include <sstream>
18
#endif
19
#include <string>
20
21
namespace
log4cpp
{
22
26
class
LOG4CPP_EXPORT
PatternLayout
:
public
Layout
{
27
public
:
31
static
const
char
*
DEFAULT_CONVERSION_PATTERN
;
32
36
static
const
char
*
SIMPLE_CONVERSION_PATTERN
;
37
41
static
const
char
*
BASIC_CONVERSION_PATTERN
;
42
47
static
const
char
*
TTCC_CONVERSION_PATTERN
;
48
49
PatternLayout
();
50
virtual
~PatternLayout
();
51
52
// NOTE: All double percentage signs ('%%') followed by a character
53
// in the following comments should actually be a single char.
54
// The doubles are included so that doxygen will print them correctly.
60
virtual
std::string
format
(
const
LoggingEvent
& event);
61
85
virtual
void
setConversionPattern
(
const
std::string& conversionPattern);
86
87
virtual
std::string
getConversionPattern
()
const
;
88
89
virtual
void
clearConversionPattern
();
90
91
class
LOG4CPP_EXPORT
PatternComponent
{
92
public
:
93
inline
virtual
~PatternComponent
() {};
94
virtual
void
append
(
std::ostringstream
& out,
const
LoggingEvent
& event) = 0;
95
};
96
97
private
:
98
typedef
std::vector<PatternComponent*> ComponentVector;
99
ComponentVector _components;
100
101
std::string _conversionPattern;
102
};
103
}
// namespace log4cpp
104
105
#endif
// _LOG4CPP_PATTERNLAYOUT_HH
Configurator.hh
LOG4CPP_EXPORT
#define LOG4CPP_EXPORT
Definition
Export.hh:26
Layout.hh
Portability.hh
log4cpp::Layout
Extend this abstract class to create your own log layout format.
Definition
Layout.hh:22
log4cpp::PatternLayout::PatternComponent
Definition
PatternLayout.hh:91
log4cpp::PatternLayout::PatternComponent::append
virtual void append(std::ostringstream &out, const LoggingEvent &event)=0
log4cpp::PatternLayout::PatternComponent::~PatternComponent
virtual ~PatternComponent()
Definition
PatternLayout.hh:93
log4cpp::PatternLayout::getConversionPattern
virtual std::string getConversionPattern() const
Definition
PatternLayout.cpp:380
log4cpp::PatternLayout::format
virtual std::string format(const LoggingEvent &event)
Formats the LoggingEvent in the style set by the setConversionPattern call.
Definition
PatternLayout.cpp:384
log4cpp::PatternLayout::TTCC_CONVERSION_PATTERN
static const char * TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCLayout.
Definition
PatternLayout.hh:47
log4cpp::PatternLayout::setConversionPattern
virtual void setConversionPattern(const std::string &conversionPattern)
Sets the format of log lines handled by this PatternLayout.
Definition
PatternLayout.cpp:265
log4cpp::PatternLayout::PatternLayout
PatternLayout()
Definition
PatternLayout.cpp:246
log4cpp::PatternLayout::clearConversionPattern
virtual void clearConversionPattern()
Definition
PatternLayout.cpp:257
log4cpp::PatternLayout::DEFAULT_CONVERSION_PATTERN
static const char * DEFAULT_CONVERSION_PATTERN
The default conversion pattern.
Definition
PatternLayout.hh:31
log4cpp::PatternLayout::SIMPLE_CONVERSION_PATTERN
static const char * SIMPLE_CONVERSION_PATTERN
A conversion pattern equivalent to the SimpleLayout.
Definition
PatternLayout.hh:36
log4cpp::PatternLayout::BASIC_CONVERSION_PATTERN
static const char * BASIC_CONVERSION_PATTERN
A conversion pattern equivalent to the BasicLayout.
Definition
PatternLayout.hh:41
std::ostringstream
Definition
Portability.hh:62
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
log4cpp::LoggingEvent
The internal representation of logging events.
Definition
LoggingEvent.hh:32
include
log4cpp
PatternLayout.hh
Generated by
1.17.0