A Formatter provides support for formatting LogRecords. More...
#include <src/main/decaf/util/logging/Formatter.h>

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. | |
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.
| virtual decaf::util::logging::Formatter::~Formatter | ( | ) | [inline, virtual] |
| virtual std::string decaf::util::logging::Formatter::format | ( | const LogRecord & | record | ) | const [pure virtual] |
Format the given log record and return the formatted string.
| record | The Log Record to Format |
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.
| record | The Log Record to Format |
| 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.
| handler | The target handler, can be NULL. |
| 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
| handler | the target handler, can be null |
1.6.1