Loading...
Searching...
No Matches
PatternLayout.hh
Go to the documentation of this file.
/*
* PatternLayout.hh
*
* Copyright 2002, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_PATTERNLAYOUT_HH
#define _LOG4SHIB_PATTERNLAYOUT_HH
#include <log4shib/Portability.hh>
#include <log4shib/Layout.hh>
#include <log4shib/Configurator.hh>
#include <vector>
#ifdef LOG4SHIB_HAVE_SSTREAM
#include <sstream>
#endif
namespace log4shib {
class LOG4SHIB_EXPORT PatternLayout : public Layout {
public:
static const char* DEFAULT_CONVERSION_PATTERN;
static const char* SIMPLE_CONVERSION_PATTERN;
static const char* BASIC_CONVERSION_PATTERN;
static const char* TTCC_CONVERSION_PATTERN;
PatternLayout();
virtual ~PatternLayout();
virtual std::string format(const LoggingEvent& event);
virtual void setConversionPattern(const std::string& conversionPattern);
virtual std::string getConversionPattern() const;
virtual void clearConversionPattern();
class LOG4SHIB_EXPORT PatternComponent {
public:
inline virtual ~PatternComponent() {};
virtual void append(std::ostringstream& out, const LoggingEvent& event) = 0;
};
private:
typedef std::vector<PatternComponent*> ComponentVector;
ComponentVector _components;
std::string _conversionPattern;
};
}
#endif // _LOG4SHIB_PATTERNLAYOUT_HH
Configurator.hh
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
Layout.hh
Portability.hh
log4shib::Layout
Extend this abstract class to create your own log layout format.
Definition Layout.hh:22
log4shib::PatternLayout::PatternComponent
Definition PatternLayout.hh:88
log4shib::PatternLayout::PatternComponent::~PatternComponent
virtual ~PatternComponent()
Definition PatternLayout.hh:90
log4shib::PatternLayout::PatternComponent::append
virtual void append(std::ostringstream &out, const LoggingEvent &event)=0
log4shib::PatternLayout::clearConversionPattern
virtual void clearConversionPattern()
Definition PatternLayout.cpp:274
log4shib::PatternLayout::DEFAULT_CONVERSION_PATTERN
static const char * DEFAULT_CONVERSION_PATTERN
The default conversion pattern.
Definition PatternLayout.hh:30
log4shib::PatternLayout::SIMPLE_CONVERSION_PATTERN
static const char * SIMPLE_CONVERSION_PATTERN
A conversion pattern equivalent to the SimpleLayout.
Definition PatternLayout.hh:35
log4shib::PatternLayout::BASIC_CONVERSION_PATTERN
static const char * BASIC_CONVERSION_PATTERN
A conversion pattern equivalent to the BasicLayout.
Definition PatternLayout.hh:40
log4shib::PatternLayout::getConversionPattern
virtual std::string getConversionPattern() const
Definition PatternLayout.cpp:398
log4shib::PatternLayout::PatternLayout
PatternLayout()
Definition PatternLayout.cpp:263
log4shib::PatternLayout::format
virtual std::string format(const LoggingEvent &event)
Formats the LoggingEvent in the style set by the setConversionPattern call.
Definition PatternLayout.cpp:402
log4shib::PatternLayout::TTCC_CONVERSION_PATTERN
static const char * TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCLayout.
Definition PatternLayout.hh:46
log4shib::PatternLayout::setConversionPattern
virtual void setConversionPattern(const std::string &conversionPattern)
Sets the format of log lines handled by this PatternLayout.
Definition PatternLayout.cpp:283
std::ostringstream
Definition Portability.hh:38
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
log4shib::LoggingEvent
The internal representation of logging events.
Definition LoggingEvent.hh:32