wmi

git clone git://oldgit.suckless.org/wmi/
Log | Files | Refs | LICENSE

logger.h (642B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __LOGGER_H
      5 #define __LOGGER_H
      6 
      7 #include <fstream>
      8 #include <string>
      9 
     10 #include "singleton.h"
     11 #include "wmi.h"
     12 
     13 // forward declaration
     14 class Logger;
     15 
     16 /**
     17  * Basic logger which distinguishes error, warning and debug logging.
     18  */
     19 class Logger : public Singleton<Logger>
     20 {
     21 
     22 public:
     23 
     24     Logger();
     25     ~Logger();
     26 
     27     /** If fatal <code>true</code> then exit(1) occurs */
     28     void error(string message, bool fatal = false); // will be logged always
     29     void warning(string message);
     30     void debug(string message);
     31 
     32 };
     33 
     34 #endif // __LOGGER_H