Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsLogger.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsLogger.h
4  *
5  * Description: Abstract class that handles logs
6  *
7  * Created: 02/10/12 15:36:22
8  *
9  * Author: Benoit Daccache, ben.daccache@gmail.com
10  *
11  */
12 
13 #ifndef WS_LOGGER_H__
14 #define WS_LOGGER_H__
15 #include <iostream>
16 #include <sstream>
17 #include "WsLogWriter.h"
18 
19 #ifdef LOG
20 #undef LOG
21 #endif
22 #define LOG WsLogger().log
23 
24 #ifdef DEBUG
25 #undef DEBUG
26 #endif
27 #define DEBUG 0
28 
29 #ifdef INFO
30 #undef INFO
31 #endif
32 #define INFO 1
33 
34 #ifdef WARN
35 #undef WARN
36 #endif
37 #define WARN 2
38 
39 #ifdef ERROR
40 #undef ERROR
41 #endif
42 #define ERROR 3
43 
47 class WsLogger {
48 public:
52  WsLogger();
53 
58  std::stringstream& log(int level = 1);
59 
63  ~WsLogger();
64 
65 private:
66  std::stringstream m_ss;
67  int m_level;
68 };
69 
70 #endif
std::stringstream & log(int level=1)
append the text to the stream. On each object destruction, the text will be written in the log ...
Definition: WsLogger.cpp:27
std::stringstream m_ss
Definition: WsLogger.h:66
int m_level
Definition: WsLogger.h:67
~WsLogger()
destructor writes the text to the file
Definition: WsLogger.cpp:22
Logger used in FsDaemon.
Definition: WsLogger.h:47
WsLogger()
constructor
Definition: WsLogger.cpp:17