|
RSTools 3.1.0
Versatile C++20 utility library
|
Turns a LogMessage into a line of text following a pattern. More...
#include <RST/log/Format/Formatter.hpp>
Public Member Functions | |
| Formatter (std::string_view pattern=DEFAULT_PATTERN) | |
| void | format (const LogMessage &message, std::string &dest) const |
Appends the formatted message to dest. | |
| std::string | format (const LogMessage &message) const |
| void | setPattern (std::string_view pattern) |
| const std::string & | getPattern () const noexcept |
Static Public Attributes | |
| static constexpr std::string_view | DEFAULT_PATTERN = "[%Y-%m-%d %H:%M:%S.%e] [%l] [%n] %v" |
Turns a LogMessage into a line of text following a pattern.
Pattern codes: Y m d date, H M S e time with milliseconds, l level, L short level, n logger name, v message, f F %# source file, function and line, t thread id, P process id and %% a percent sign.
|
explicit |
| void RST::Log::Formatter::format | ( | const LogMessage & | message, |
| std::string & | dest | ||
| ) | const |
Appends the formatted message to dest.
| std::string RST::Log::Formatter::format | ( | const LogMessage & | message | ) | const |
| void RST::Log::Formatter::setPattern | ( | std::string_view | pattern | ) |
|
inlinenoexcept |
|
staticconstexpr |