#include <patternformatter.h>
Public Member Functions | |
PatternFormatter (const QString &rPattern) | |
virtual | ~PatternFormatter () |
QString | format (const LoggingEvent &rLoggingEvent) const |
Friends | |
QDebug | operator<< (QDebug, const PatternFormatter &rPatternFormatter) |
The class PatternFormatter formats a LoggingEvent base on a pattern string. It is used by the patternLayout and TTCCLayout class to implement the formatting.
On object construction the provided patterns tring is parsed. Based on the information found a chain of PatternConverter is created. Each PatternConverter handles a certain member of a LoggingEvent.
Log4Qt::PatternFormatter::PatternFormatter | ( | const QString & | rPattern | ) |
Creates a PatternFormatter using a the specified rPattern.
virtual Log4Qt::PatternFormatter::~PatternFormatter | ( | ) | [virtual] |
Destroys the PatternFormatter and all PatternConverter.
QString Log4Qt::PatternFormatter::format | ( | const LoggingEvent & | rLoggingEvent | ) | const |
Formats the given rLoggingEvent using the chain of PatternConverter created during construction from the specified pattern.
QDebug operator<< | ( | QDebug | , | |
const PatternFormatter & | rPatternFormatter | |||
) | [friend] |
Writes all object member variables to the given debug stream rDebug and returns the stream.
PatternFormatter(pattern:"%r [%t] %p %c %x - %m%n" converters:( DatePatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) format: "RELATIVE" ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: " [" ) , BasicPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) type: "THREAD_CONVERTER" ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: "] " ) , BasicPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) type: "LEVEL_CONVERTER" ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: " " ) , LoggerPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) precision: 0 ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: " " ) , BasicPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) type: "NDC_CONVERTER" ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: " - " ) , BasicPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) type: "MESSAGE_CONVERTER" ) , LiteralPatternConverter(FormattingInfo(min:"0" max:"INT_MAX" left:false) literal: "" ) ) )