Lugdunum
0.1.0
include
lug
System
Logger
OstreamHandler.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <ostream>
4
#include <
lug/System/Export.hpp
>
5
#include <
lug/System/Logger/Handler.hpp
>
6
7
namespace
lug
{
8
namespace
System {
9
namespace
Logger {
10
11
class
LUG_SYSTEM_API
OstreamHandler
:
public
Handler
{
12
public
:
13
OstreamHandler
(
const
std::string& name, std::ostream& out);
14
15
OstreamHandler
(
const
OstreamHandler
&) =
delete
;
16
OstreamHandler
(
OstreamHandler
&&) =
delete
;
17
18
OstreamHandler
& operator=(
const
OstreamHandler
&) =
delete
;
19
OstreamHandler
& operator=(
OstreamHandler
&&) =
delete
;
20
21
virtual
~
OstreamHandler
() =
default
;
22
23
void
handle(
const
priv::Message& msg)
final
;
24
void
flush()
final
;
25
26
private
:
27
std::ostream&
_os
;
28
};
29
30
class
LUG_SYSTEM_API
StdoutHandler
:
public
OstreamHandler
{
31
public
:
32
StdoutHandler
(
const
std::string& name);
33
34
StdoutHandler
(
const
StdoutHandler
&) =
delete
;
35
StdoutHandler
(
StdoutHandler
&&) =
delete
;
36
37
StdoutHandler
& operator=(
const
StdoutHandler
&) =
delete
;
38
StdoutHandler
& operator=(
StdoutHandler
&&) =
delete
;
39
40
~
StdoutHandler
() =
default
;
41
};
42
43
class
LUG_SYSTEM_API
StderrHandler
:
public
OstreamHandler
{
44
public
:
45
StderrHandler
(
const
std::string& name);
46
47
StderrHandler
(
const
StderrHandler
&) =
delete
;
48
StderrHandler
(
StderrHandler
&&) =
delete
;
49
50
StderrHandler
& operator=(
const
StderrHandler
&) =
delete
;
51
StderrHandler
& operator=(
StderrHandler
&&) =
delete
;
52
53
~
StderrHandler
() =
default
;
54
};
55
56
}
// Logger
57
}
// System
58
}
// lug
Handler.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::OstreamHandler
Definition:
OstreamHandler.hpp:11
lug::System::Logger::OstreamHandler::_os
std::ostream & _os
Definition:
OstreamHandler.hpp:27
lug::System::Logger::StderrHandler
Definition:
OstreamHandler.hpp:43
lug
Definition:
Application.hpp:11
lug::System::Logger::StdoutHandler
Definition:
OstreamHandler.hpp:30
Generated by
1.8.13