Lugdunum
0.1.0
include
lug
System
Logger
Logger.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <memory>
4
#include <set>
5
#include <string>
6
7
#include <
lug/System/Export.hpp
>
8
#include <
lug/System/Logger/Common.hpp
>
9
#include <
lug/System/Logger/LoggingFacility.hpp
>
10
#include <
lug/System/Logger/Message.hpp
>
11
12
namespace
lug
{
13
namespace
System {
14
namespace
Logger {
15
16
class
Handler;
17
18
class
LUG_SYSTEM_API
Logger
{
19
public
:
20
explicit
Logger
(
const
std::string& loggerName);
21
22
Logger
(
const
Logger
&) =
delete
;
23
Logger
(
Logger
&&) =
default
;
24
25
Logger
& operator=(
const
Logger
&) =
delete
;
26
Logger
& operator=(
Logger
&&) =
default
;
27
28
~
Logger
() =
default
;
29
30
void
addHandler(
Handler
* handler);
31
void
addHandler(
const
std::string& name);
32
33
void
defaultErrHandler(
const
std::string& msg);
34
void
defaultErrHandler(
const
std::exception& ex);
35
36
template
<
typename
T>
37
void
log(
Level
lvl,
const
T& msg);
38
39
template
<
typename
... Args,
typename
T>
40
void
log(
Level
lvl,
const
T& fmt, Args&&... args);
41
42
template
<
typename
T,
typename
... Args>
43
void
debug(
const
T& fmt, Args&&... args);
44
45
template
<
typename
T,
typename
... Args>
46
void
info(
const
T& fmt, Args&&... args);
47
48
template
<
typename
T,
typename
... Args>
49
void
warn(
const
T& fmt, Args&&... args);
50
51
template
<
typename
T,
typename
... Args>
52
void
error(
const
T& fmt, Args&&... args);
53
54
template
<
typename
T,
typename
... Args>
55
void
fatal(
const
T& fmt, Args&&... args);
56
57
template
<
typename
T,
typename
... Args>
58
void
assrt(
const
T& fmt, Args&&... args);
59
60
const
std::string& getName()
const
;
61
void
handle(priv::Message& msg);
62
void
flush();
63
64
static
Logger
& getInternalLogger();
65
66
protected
:
67
const
std::string
_name
;
68
std::set<Handler*>
_handlers
;
69
};
70
71
#include <
lug/System/Logger/Logger.inl
>
72
73
#define LUG_LOG ::lug::System::Logger::Logger::getInternalLogger()
74
75
}
// Logger
76
}
// System
77
}
// lug
78
Message.hpp
lug::System::Logger::Handler
Definition:
Handler.hpp:15
Export.hpp
LUG_SYSTEM_API
#define LUG_SYSTEM_API
Definition:
Export.hpp:11
lug::System::Logger::Level
Level
Definition:
Common.hpp:35
lug::System::Logger::Logger::_handlers
std::set< Handler * > _handlers
Definition:
Logger.hpp:68
Logger.inl
lug::System::Logger::Logger
Definition:
Logger.hpp:18
lug
Definition:
Application.hpp:11
LoggingFacility.hpp
Common.hpp
lug::System::Logger::Logger::_name
const std::string _name
Definition:
Logger.hpp:67
Generated by
1.8.13