Log4Qt::PatternFormatter Class Reference

The class PatternFormatter formats a logging event based on a pattern string. More...

#include <patternformatter.h>

List of all members.

Public Member Functions

 PatternFormatter (const QString &rPattern)
virtual ~PatternFormatter ()
QString format (const LoggingEvent &rLoggingEvent) const

Friends

QDebug operator<< (QDebug, const PatternFormatter &rPatternFormatter)


Detailed Description

The class PatternFormatter formats a logging event based on a pattern string.

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.

See also:
PatternLayout::format()

TTCCLayout::format()


Constructor & Destructor Documentation

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.


Member Function Documentation

QString Log4Qt::PatternFormatter::format ( const LoggingEvent rLoggingEvent  )  const

Formats the given rLoggingEvent using the chain of PatternConverter created during construction from the specified pattern.


Friends And Related Function Documentation

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: "" ) ) )

See also:
QDebug


The documentation for this class was generated from the following file:

Generated on Sun Mar 1 16:40:46 2009 for Log4Qt by  doxygen 1.5.6