activemq-cpp-3.6.0
decaf::util::logging::Formatter Class Reference

A Formatter provides support for formatting LogRecords. More...

#include <src/main/decaf/util/logging/Formatter.h>

Inheritance diagram for decaf::util::logging::Formatter:

Public Member Functions

virtual ~Formatter ()
virtual std::string format (const LogRecord &record) const =0
 Format the given log record and return the formatted string.
virtual std::string formatMessage (const LogRecord &record) const
 Format the message string from a log record.
virtual std::string getHead (const Handler *handler DECAF_UNUSED)
 Return the header string for a set of formatted records.
virtual std::string getTail (const Handler *handler DECAF_UNUSED)
 Return the tail string for a set of formatted records.

Detailed Description

A Formatter provides support for formatting LogRecords.

Typically each logging Handler will have a Formatter associated with it. The Formatter takes a LogRecord and converts it to a string.

Some formatters (such as the XMLFormatter) need to wrap head and tail strings around a set of formatted records. The getHeader and getTail methods can be used to obtain these strings.

Constructor & Destructor Documentation

virtual decaf::util::logging::Formatter::~Formatter ( )
inlinevirtual

Member Function Documentation

virtual std::string decaf::util::logging::Formatter::format ( const LogRecord record) const
pure virtual

Format the given log record and return the formatted string.

Parameters
recordThe Log Record to Format
Returns
the formatted record.

Implemented in decaf::util::logging::XMLFormatter, and decaf::util::logging::SimpleFormatter.

virtual std::string decaf::util::logging::Formatter::formatMessage ( const LogRecord record) const
virtual

Format the message string from a log record.

Parameters
recordThe Log Record to Format
Returns
the formatted message
virtual std::string decaf::util::logging::Formatter::getHead ( const Handler *handler  DECAF_UNUSED)
inlinevirtual

Return the header string for a set of formatted records.

In the default implementation this method should return empty string.

Parameters
handlerThe target handler, can be NULL.
Returns
the head string.
virtual std::string decaf::util::logging::Formatter::getTail ( const Handler *handler  DECAF_UNUSED)
inlinevirtual

Return the tail string for a set of formatted records.

In the default implementation this method should return empty string

Parameters
handlerthe target handler, can be null
Returns
the tail string

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