FreeStick  0.3
Cross Platform Open Sorce Joystick Lib
EELog.h
Go to the documentation of this file.
1 /*
2 * EELog.h
3 *
4 * Epee Engine
5 * Created by Alan Uthoff on 3/12/06.
6 Copyright (C) 2011
7 
8 This Code is free software; you can redistribute it and/or
9 modify it under the terms of the zlib/libpng License as published
10 by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12 This software is provided 'as-is', without any express or implied warranty.
13 
14 In no event will the authors be held liable for any damages arising from the use of this software.
15 
16 Permission is granted to anyone to use this software for any purpose,
17 including commercial applications, and to alter it and redistribute
18 it freely, subject to the following restrictions:
19 
20 1. The origin of this software must not be misrepresented;
21 you must not claim that you wrote the original software.
22 If you use this software in a product, an acknowledgment
23 in the product documentation would be appreciated but is not required.
24 
25 2. Altered source versions must be plainly marked as such,
26 and must not be misrepresented as being the original software.
27 
28 3. This notice may not be removed or altered from any source distribution.
29 
30 
31 */
32 #ifndef Example_EELog_h
33 #define Example_EELog_h
34 #include "EEStream.h"
35 #include <ostream>
36 #include <sstream>
37 
39 {
45 };
46 #ifdef TURN_OFF_LOGGING
47  #define EE_INFO EELog::GetInstance()->GetLogLevel(EE_LEVEL_INFO)
48  #define EE_WARNING EELog::GetInstance()->GetLogLevel(EE_LEVEL_WARNING)
49  #define EE_ERROR EELog::GetInstance()->GetLogLevel(EE_LEVEL_ERROR)
50  #define EE_DEBUG EELog::GetInstance()->GetLogLevel(EE_LEVEL_DEBUG)
51 #else
52  #define EE_INFO EELog::GetInstance()->GetLogLevel(EE_LEVEL_INFO)
53  #define EE_WARNING EELog::GetInstance()->GetLogLevel(EE_LEVEL_WARNING)
54  #define EE_ERROR EELog::GetInstance()->GetLogLevel(EE_LEVEL_ERROR)
55  #define EE_DEBUG EELog::GetInstance()->GetLogLevel(EE_LEVEL_DEBUG)
56 #endif
57 class EELog
58 {
59 
60 public:
61  static EELog * GetInstance();
62  static void Destroy();
64 
65 protected:
67 private:
68  static EELog * EELogInstance;
69  bool isInited;
70  EELog(){isInited = false;}
71  ~EELog();
72  EELog(const EELog &){};
73  EELog & operator = (const EELog &)
74  {
75  return *this;
76  }
77  void Init();
78  void TearDown();
79  void PrependLevelInformation(EELogLevels _Level);
80 
81 };
82 
83 #endif
Definition: EELog.h:40
static EELog * GetInstance()
Definition: EELog.cpp:39
Definition: EELog.h:57
EEStream * m_StreamLevels[EE_LEVEL_LAST]
Definition: EELog.h:66
Definition: EELog.h:42
Definition: EELog.h:41
EEStream & GetLogLevel(EELogLevels _Level)
Definition: EELog.cpp:113
static void Destroy()
EELogLevels
Definition: EELog.h:38
Definition: EELog.h:44
Definition: EEStream.h:40
Definition: EELog.h:43