QLogger
Loading...
Searching...
No Matches
logformatter.h
1#ifndef QLOGGER_LOGFORMATTER_H
2#define QLOGGER_LOGFORMATTER_H
3
4#include "logentry.h"
5#include "logbinary.h"
6
7namespace QLogger
8{
9
10class QLOGGER_EXPORT LogFormatter
11{
12
13public:
14 using CbFormatter = std::function<QString(const LogEntry &log)>;
15
16public:
17 static LogBinary format(const LogEntry &log);
18 static void setCustomFormat(CbFormatter formatter);
19
20private:
21 static QString defaultFormatter(const LogEntry &log);
22
23private:
24 static CbFormatter m_formatter;
25};
26
27} // Namespace QLogger
28
29#endif // QLOGGER_LOGFORMATTER_H
Used to store all log entry informations.
Definition logentry.h:13
Use to format log.
Definition logformatter.h:11
std::function< QString(const LogEntry &log)> CbFormatter
Callback used when formatting log message.
Definition logformatter.h:14