QLogger
|
Use to format log. More...
Public Types | |
using | CbFormatter = std::function<QString(const LogEntry &log)> |
Callback used when formatting log message. | |
Static Public Member Functions | |
static LogBinary | format (const LogEntry &log) |
static void | setCustomFormat (CbFormatter formatter) |
Register a custom formatter. | |
Use to format log.
This class allow to format QLogger::LogEntry
to a QLogger::LogBinary
using a custom formatter.
By default, log entries will be formatted to:
[utc-date][type-log] log-msg
[utc-date][type-log] log-msg (cpp-file:cpp-line, cpp-function)
For more details about context informations, please refer to QLogger::LogEntry
To use a custom formatter, use setCustomFormat()
using QLogger::LogFormatter::CbFormatter = std::function<QString(const LogEntry &log)> |
Callback used when formatting log message.
We can register a custom callback format by using:
[in] | logEntry | Log entry to format. |
|
static |
Register a custom formatter.
formatter | Formatter to use. |