Formats a LogRecord as: the time (if a time format is set), the 4-digit record counter, the 3-letter level, for levels other than INFO the file name (without directories), a colon and the line number, and the message text.
More...
#include <Logger.hh>
|
| | LogFormatter (const std::string &fmt="", const std::string &timefmt="") |
| | Store timefmt; fmt is ignored.
|
| |
| virtual | ~LogFormatter () |
| | Destructor; does nothing.
|
| |
| virtual void | addFormat (const level_t &level, const std::string &fmt) |
| | add format
|
| |
| virtual void | setTimeFormat (const std::string &timefmt="") |
| | Set the strftime time format (f is replaced by milliseconds); an empty format leaves the time out.
|
| |
| virtual void | format (const LogRecord &rec, std::ostream &out) |
| | format message to the output stream
|
| |
|
| virtual const std::string & | getFormat (const level_t &level) const |
| | get a format string for a given level
|
| |
Formats a LogRecord as: the time (if a time format is set), the 4-digit record counter, the 3-letter level, for levels other than INFO the file name (without directories), a colon and the line number, and the message text.
◆ level_t
◆ LogFormatter()
| Logger::LogFormatter::LogFormatter |
( |
const std::string & |
fmt = "", |
|
|
const std::string & |
timefmt = "" |
|
) |
| |
Store timefmt; fmt is ignored.
◆ ~LogFormatter()
| virtual Logger::LogFormatter::~LogFormatter |
( |
| ) |
|
|
inlinevirtual |
Destructor; does nothing.
◆ addFormat()
| virtual void Logger::LogFormatter::addFormat |
( |
const level_t & |
level, |
|
|
const std::string & |
fmt |
|
) |
| |
|
virtual |
◆ format()
| virtual void Logger::LogFormatter::format |
( |
const LogRecord & |
rec, |
|
|
std::ostream & |
out |
|
) |
| |
|
virtual |
format message to the output stream
◆ getFormat()
| virtual const std::string & Logger::LogFormatter::getFormat |
( |
const level_t & |
level | ) |
const |
|
protectedvirtual |
get a format string for a given level
◆ setTimeFormat()
| virtual void Logger::LogFormatter::setTimeFormat |
( |
const std::string & |
timefmt = "" | ) |
|
|
virtual |
Set the strftime time format (f is replaced by milliseconds); an empty format leaves the time out.
The documentation for this class was generated from the following file: