QLogger
Loading...
Searching...
No Matches
qlogger
base
baselogger.h
1
#ifndef QLOGGER_BASELOGGER_H
2
#define QLOGGER_BASELOGGER_H
3
4
#include <QHash>
5
#include <QObject>
6
7
#include "qlogger/log/logbinary.h"
8
9
namespace
QLogger
10
{
11
12
class
BaseLogger
:
public
QObject
13
{
14
Q_OBJECT
15
16
public
:
17
BaseLogger
(
bool
enableConsole, QObject *parent =
nullptr
);
18
virtual
~BaseLogger
() =
default
;
19
20
public
:
21
void
setLevel
(QtMsgType idType);
22
void
writeLog(
const
LogBinary &log);
23
24
public
:
25
virtual
void
start() = 0;
26
27
protected
:
28
virtual
void
write(
const
LogBinary &log) = 0;
29
virtual
void
flush() = 0;
30
31
private
:
32
void
printToConsole(
const
LogBinary &log);
33
34
private
:
35
int
m_minPriority = 0;
36
bool
m_enableConsole;
37
38
private
:
39
static
const
QHash<QtMsgType, int> MAP_LEVEL_PRIORITY;
40
};
41
42
}
// Namespace QLogger
43
44
#endif
// QLOGGER_BASELOGGER_H
QLogger::BaseLogger
Definition
baselogger.h:13
QLogger::BaseLogger::setLevel
void setLevel(QtMsgType idType)
Use to set minimum level of log message to be managed.
Definition
baselogger.cpp:70
Generated on Fri Dec 6 2024 10:00:08 for QLogger by
1.12.0