Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_game
Debug
SimpleLogger.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
ivorium_core/ivorium_core.hpp
>
4
5
namespace
iv
6
{
7
11
class
SimpleLogger
:
public
DebugInstanceListener
12
{
13
public
:
14
enum class
Flags
15
{
16
Disabled
= 0,
17
Enabled
= 1<<0,
18
Critical
= 1<<1,
19
SrcInfo
= 1<<2,
20
InstanceDump
= 1<<3,
21
};
22
23
ClientMarker
cm
;
24
SimpleLogger
(
Instance
* inst );
25
26
protected
:
27
virtual
Flags
ClientLogFlags
(
ClientMarker
const
* marker,
LogId
id
) = 0;
28
virtual
Flags
SystemLogFlags
(
System
const
* system,
LogId
id
) = 0;
29
30
private
:
31
virtual
void
ClientLog(
ClientMarker
const
* marker,
SrcInfo
const
& info,
LogId
id
, std::string
const
& message )
override
;
32
virtual
bool
ClientLogEnabled(
ClientMarker
const
* marker,
LogId
id
)
override
;
33
34
virtual
void
SystemLog(
System
const
* system,
SrcInfo
const
& info,
LogId
id
, std::string
const
& message )
override
;
35
virtual
bool
SystemLogEnabled(
System
const
* system,
LogId
id
)
override
;
36
37
void
Print( std::string name,
LogId
id
, std::string entry );
38
39
private
:
40
Ostream_TextDebugView
text_view;
41
unsigned
trace_change_counter;
42
};
43
44
45
template
<>
46
struct
StringIO
<
SimpleLogger
::Flags > :
public
StringIO_Table
< SimpleLogger::Flags >
47
{
48
static
const
ValuesType
Values
;
49
};
50
51
52
}