log4shib 2.0.1
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 _LOG4SHIB_PATTERNLAYOUT_HH
10#define _LOG4SHIB_PATTERNLAYOUT_HH
11
13#include <log4shib/Layout.hh>
15#include <vector>
16#ifdef LOG4SHIB_HAVE_SSTREAM
17#include <sstream>
18#endif
19
20namespace log4shib {
21
26 public:
30 static const char* DEFAULT_CONVERSION_PATTERN;
31
35 static const char* SIMPLE_CONVERSION_PATTERN;
36
40 static const char* BASIC_CONVERSION_PATTERN;
41
46 static const char* TTCC_CONVERSION_PATTERN;
47
49 virtual ~PatternLayout();
50
56 virtual std::string format(const LoggingEvent& event);
57
82 virtual void setConversionPattern(const std::string& conversionPattern);
83
84 virtual std::string getConversionPattern() const;
85
86 virtual void clearConversionPattern();
87
89 public:
90 inline virtual ~PatternComponent() {};
91 virtual void append(std::ostringstream& out, const LoggingEvent& event) = 0;
92 };
93
94 private:
95 typedef std::vector<PatternComponent*> ComponentVector;
96 ComponentVector _components;
97
98 std::string _conversionPattern;
99 };
100}
101
102#endif // _LOG4SHIB_PATTERNLAYOUT_HH
#define LOG4SHIB_EXPORT
Definition Export.hh:11
Extend this abstract class to create your own log layout format.
Definition Layout.hh:22
Definition PatternLayout.hh:88
virtual ~PatternComponent()
Definition PatternLayout.hh:90
virtual void append(std::ostringstream &out, const LoggingEvent &event)=0
virtual void clearConversionPattern()
Definition PatternLayout.cpp:274
static const char * DEFAULT_CONVERSION_PATTERN
The default conversion pattern.
Definition PatternLayout.hh:30
static const char * SIMPLE_CONVERSION_PATTERN
A conversion pattern equivalent to the SimpleLayout.
Definition PatternLayout.hh:35
static const char * BASIC_CONVERSION_PATTERN
A conversion pattern equivalent to the BasicLayout.
Definition PatternLayout.hh:40
virtual std::string getConversionPattern() const
Definition PatternLayout.cpp:398
PatternLayout()
Definition PatternLayout.cpp:263
virtual std::string format(const LoggingEvent &event)
Formats the LoggingEvent in the style set by the setConversionPattern call.
Definition PatternLayout.cpp:402
static const char * TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCLayout.
Definition PatternLayout.hh:46
virtual void setConversionPattern(const std::string &conversionPattern)
Sets the format of log lines handled by this PatternLayout.
Definition PatternLayout.cpp:283
Definition Portability.hh:38
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
The internal representation of logging events.
Definition LoggingEvent.hh:32