Crazy Eddie's GUI System
0.8.4
Main Page
Related Pages
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
Logger.h
1
/***********************************************************************
2
created: 21/2/2004
3
author: Paul D Turner
4
5
purpose: Defines interface for the Logger class
6
*************************************************************************/
7
/***************************************************************************
8
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
9
*
10
* Permission is hereby granted, free of charge, to any person obtaining
11
* a copy of this software and associated documentation files (the
12
* "Software"), to deal in the Software without restriction, including
13
* without limitation the rights to use, copy, modify, merge, publish,
14
* distribute, sublicense, and/or sell copies of the Software, and to
15
* permit persons to whom the Software is furnished to do so, subject to
16
* the following conditions:
17
*
18
* The above copyright notice and this permission notice shall be
19
* included in all copies or substantial portions of the Software.
20
*
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
* OTHER DEALINGS IN THE SOFTWARE.
28
***************************************************************************/
29
#ifndef _CEGUILogger_h_
30
#define _CEGUILogger_h_
31
32
#include "CEGUI/Base.h"
33
#include "CEGUI/String.h"
34
#include <fstream>
35
#include <sstream>
36
#include <vector>
37
#include <utility>
38
#include "CEGUI/Singleton.h"
39
40
41
#if defined(_MSC_VER)
42
# pragma warning(push)
43
# pragma warning(disable : 4275)
44
# pragma warning(disable : 4251)
45
#endif
46
47
48
// Start of CEGUI namespace section
49
namespace
CEGUI
50
{
51
56
enum
LoggingLevel
57
{
58
Errors
,
59
Warnings
,
60
Standard
,
61
Informative
,
62
Insane
63
};
64
72
class
CEGUIEXPORT
Logger
:
73
public
Singleton
<Logger>,
74
public
AllocatedObject
<Logger>
75
{
76
public
:
81
Logger
(
void
);
82
86
virtual
~
Logger
(
void
);
87
88
99
void
setLoggingLevel
(
LoggingLevel
level) {d_level = level;}
100
101
109
LoggingLevel
getLoggingLevel
(
void
)
const
{
return
d_level;}
110
111
125
virtual
void
logEvent(
const
String
& message,
LoggingLevel
level =
Standard
) = 0;
126
144
virtual
void
setLogFilename(
const
String
& filename,
bool
append =
false
) = 0;
145
146
protected
:
147
LoggingLevel
d_level
;
148
149
private
:
150
/*************************************************************************
151
Copy constructor and assignment usage is denied.
152
*************************************************************************/
153
Logger
(
const
Logger
&) :
Singleton
<
Logger
>() {}
154
Logger
& operator=(
const
Logger
&) {
return
*
this
;}
155
156
};
157
158
/*************************************************************************
159
This macro is used for 'Insane' level logging so that those items are
160
excluded from non-debug builds
161
*************************************************************************/
162
#if defined(DEBUG) || defined (_DEBUG)
163
# define CEGUI_LOGINSANE( message ) CEGUI::Logger::getSingleton().logEvent((message), CEGUI::Insane);
164
#else
165
# define CEGUI_LOGINSANE( message ) (void)0
166
#endif
167
168
}
// End of CEGUI namespace section
169
170
#if defined(_MSC_VER)
171
# pragma warning(pop)
172
#endif
173
174
#endif // end of guard _CEGUILogger_h_
cegui
include
CEGUI
Logger.h
Generated by
1.8.3.1