]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/mathml_editor/src/ALogger.hh
* code cleanup
[helm.git] / helm / DEVEL / mathml_editor / src / ALogger.hh
1
2 #ifndef __ALogger_hh__
3 #define __ALogger_hh__
4
5 #include <string>
6
7 class ALogger
8 {
9 public:
10   enum Level { Error, Warning, Info, Debug };
11
12   ALogger(void) { level = Error; }
13   virtual ~ALogger() { }
14   void debug(const std::string& msg) { if (level >= Debug) message(Debug, msg); }
15   void info(const std::string& msg) { if (level >= Info) message(Info, msg); }
16   void warning(const std::string& msg) { if (level >= Warning) message(Warning, msg); }
17   void error(const std::string& msg) { if (level >= Error) message(Error, msg); }
18
19   Level verbosity(void) const { return level; }
20   void  verbosity(Level lvl) { level = lvl; }
21
22 protected:
23   virtual void message(Level, const std::string&) = 0;
24
25 private:
26   Level level;
27 };
28
29 #endif // __ALogger_hh__