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:
Inheritance graph
[legend]

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 (  )  [inline, virtual]

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:
record The Log Record to Format
Returns:
the formatted record.

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

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

Format the message string from a log record.

Parameters:
record The Log Record to Format
Returns:
the formatted message
virtual std::string decaf::util::logging::Formatter::getHead ( const Handler *handler  DECAF_UNUSED  )  [inline, virtual]

Return the header string for a set of formatted records.

In the default implementation this method should return empty string.

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

Return the tail string for a set of formatted records.

In the default implementation this method should return empty string

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

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

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1