Easy Simple Network Library  0.3.7
All Classes Functions Modules
LogManager.h
1 #ifndef _ESN_LOGMANAGER_H_
2 #define _ESN_LOGMANAGER_H_
3 
4 #include "Logger.h"
5 
6 namespace esnlib
7 {
8 
10 
12 {
13 public:
14 
15  static const int LOG_LEVEL_TRACE = 0;
16  static const int LOG_LEVEL_DEBUG = 1;
17  static const int LOG_LEVEL_INFO = 2;
18  static const int LOG_LEVEL_WARNING = 3;
19  static const int LOG_LEVEL_ERROR = 4;
20  static const int LOG_LEVEL_FATAL = 5;
21 
22  LogManager();
23  virtual ~LogManager();
24 
29  static void Init(const std::string& defaultloggername = "", const std::string& defaultlogpath = "");
30 
31  static LoggerPtr AddLogger(const std::string& loggername, const std::string& logpath = "");
32  static void RemoveLogger(const std::string& loggername);
33  static LoggerPtr GetLogger(const std::string& loggername);
34  static LoggerPtr GetDefaultLogger();
35  static void Clear();
36 
40  static void SetLogLevel(int level);
41 
45  static int GetLogLevel();
46 
50  static void Trace(const std::string& msg);
51  static void Trace(const std::string& loggername, const std::string& msg);
52 
56  static void Debug(const std::string& msg);
57  static void Debug(const std::string& loggername, const std::string& msg);
58 
62  static void Info(const std::string& msg);
63  static void Info(const std::string& loggername, const std::string& msg);
64 
68  static void Warning(const std::string& msg);
69  static void Warning(const std::string& loggername, const std::string& msg);
70 
74  static void Error(const std::string& msg);
75  static void Error(const std::string& loggername, const std::string& msg);
76 
80  static void Fatal(const std::string& msg);
81  static void Fatal(const std::string& loggername, const std::string& msg);
82 
83 protected:
84 private:
85 
86 
87 
88 };
89 
90 }
91 
92 #endif // _ESN_LOGMANAGER_H_
static void Error(const std::string &msg)
Global log manager.
Definition: LogManager.h:11
static void Trace(const std::string &msg)
static void Warning(const std::string &msg)
static void Debug(const std::string &msg)
static void Info(const std::string &msg)
static int GetLogLevel()
static void Fatal(const std::string &msg)
Definition: Buffer.h:37
static void SetLogLevel(int level)
static void Init(const std::string &defaultloggername="", const std::string &defaultlogpath="")