aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp204
1 files changed, 102 insertions, 102 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp b/libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp
index 5b3feec..7ef40ec 100644
--- a/libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp
+++ b/libraries/irrlicht-1.8/source/Irrlicht/CLogger.cpp
@@ -1,102 +1,102 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine". 2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h
4 4
5#include "CLogger.h" 5#include "CLogger.h"
6 6
7namespace irr 7namespace irr
8{ 8{
9 9
10 CLogger::CLogger(IEventReceiver* r) 10 CLogger::CLogger(IEventReceiver* r)
11 : LogLevel(ELL_INFORMATION), Receiver(r) 11 : LogLevel(ELL_INFORMATION), Receiver(r)
12 { 12 {
13 #ifdef _DEBUG 13 #ifdef _DEBUG
14 setDebugName("CLogger"); 14 setDebugName("CLogger");
15 #endif 15 #endif
16 } 16 }
17 17
18 //! Returns the current set log level. 18 //! Returns the current set log level.
19 ELOG_LEVEL CLogger::getLogLevel() const 19 ELOG_LEVEL CLogger::getLogLevel() const
20 { 20 {
21 return LogLevel; 21 return LogLevel;
22 } 22 }
23 23
24 //! Sets a new log level. 24 //! Sets a new log level.
25 void CLogger::setLogLevel(ELOG_LEVEL ll) 25 void CLogger::setLogLevel(ELOG_LEVEL ll)
26 { 26 {
27 LogLevel = ll; 27 LogLevel = ll;
28 } 28 }
29 29
30 //! Prints out a text into the log 30 //! Prints out a text into the log
31 void CLogger::log(const c8* text, ELOG_LEVEL ll) 31 void CLogger::log(const c8* text, ELOG_LEVEL ll)
32 { 32 {
33 if (ll < LogLevel) 33 if (ll < LogLevel)
34 return; 34 return;
35 35
36 if (Receiver) 36 if (Receiver)
37 { 37 {
38 SEvent event; 38 SEvent event;
39 event.EventType = EET_LOG_TEXT_EVENT; 39 event.EventType = EET_LOG_TEXT_EVENT;
40 event.LogEvent.Text = text; 40 event.LogEvent.Text = text;
41 event.LogEvent.Level = ll; 41 event.LogEvent.Level = ll;
42 if (Receiver->OnEvent(event)) 42 if (Receiver->OnEvent(event))
43 return; 43 return;
44 } 44 }
45 45
46 os::Printer::print(text); 46 os::Printer::print(text);
47 } 47 }
48 48
49 49
50 //! Prints out a text into the log 50 //! Prints out a text into the log
51 void CLogger::log(const c8* text, const c8* hint, ELOG_LEVEL ll) 51 void CLogger::log(const c8* text, const c8* hint, ELOG_LEVEL ll)
52 { 52 {
53 if (ll < LogLevel) 53 if (ll < LogLevel)
54 return; 54 return;
55 55
56 core::stringc s = text; 56 core::stringc s = text;
57 s += ": "; 57 s += ": ";
58 s += hint; 58 s += hint;
59 log (s.c_str(), ll); 59 log (s.c_str(), ll);
60 } 60 }
61 61
62 //! Prints out a text into the log 62 //! Prints out a text into the log
63 void CLogger::log(const wchar_t* text, ELOG_LEVEL ll) 63 void CLogger::log(const wchar_t* text, ELOG_LEVEL ll)
64 { 64 {
65 if (ll < LogLevel) 65 if (ll < LogLevel)
66 return; 66 return;
67 67
68 core::stringc s = text; 68 core::stringc s = text;
69 log(s.c_str(), ll); 69 log(s.c_str(), ll);
70 } 70 }
71 71
72 72
73 //! Prints out a text into the log 73 //! Prints out a text into the log
74 void CLogger::log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll) 74 void CLogger::log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll)
75 { 75 {
76 if (ll < LogLevel) 76 if (ll < LogLevel)
77 return; 77 return;
78 78
79 core::stringc s1 = text; 79 core::stringc s1 = text;
80 core::stringc s2 = hint; 80 core::stringc s2 = hint;
81 log(s1.c_str(), s2.c_str(), ll); 81 log(s1.c_str(), s2.c_str(), ll);
82 } 82 }
83 83
84 //! Prints out a text into the log 84 //! Prints out a text into the log
85 void CLogger::log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll) 85 void CLogger::log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll)
86 { 86 {
87 if (ll < LogLevel) 87 if (ll < LogLevel)
88 return; 88 return;
89 89
90 core::stringc s2 = hint; 90 core::stringc s2 = hint;
91 log( text, s2.c_str(), ll); 91 log( text, s2.c_str(), ll);
92 } 92 }
93 93
94 //! Sets a new event receiver 94 //! Sets a new event receiver
95 void CLogger::setReceiver(IEventReceiver* r) 95 void CLogger::setReceiver(IEventReceiver* r)
96 { 96 {
97 Receiver = r; 97 Receiver = r;
98 } 98 }
99 99
100 100
101} // end namespace irr 101} // end namespace irr
102 102