libnavajo
web server for static and dynamic pages developement in C++
LogOutput.hh
Go to the documentation of this file.
1 //********************************************************
12 //********************************************************
13 
14 #ifndef LOGOUTPUT_HH_
15 #define LOGOUTPUT_HH_
16 
17 #include <string>
18 
19  typedef enum
20  {
21  NVJ_DEBUG,
22  NVJ_INFO,
23  NVJ_WARNING,
24  NVJ_ALERT,
25  NVJ_ERROR,
26  NVJ_FATAL
27  } NvjLogSeverity;
28 
29 
30  class LogOutput
31  {
32  bool withDateTime;
33  bool withEndline;
34 
35  protected:
36  inline void setWithDateTime(bool b) { withDateTime=b; };
37  inline void setWithEndline(bool b) { withEndline=b; };
38 
39 
40  public:
41  LogOutput(): withDateTime(true),withEndline(false) { };
42  virtual void initialize() = 0;
43  virtual void append(const NvjLogSeverity& l, const std::string& m, const std::string &details) = 0;
44  virtual ~LogOutput() {};
45  inline bool isWithDateTime() { return withDateTime; };
46  inline bool isWithEndline() { return withEndline; };
47 
48  };
49 
50 
51 #endif
Definition: LogOutput.hh:30