1 // Copyright 2009 The Archiveopteryx Developers <info@aox.org> 2 3 #ifndef LOG_H 4 #define LOG_H 5 6 #include "global.h" 7 #include "estring.h" 8 9 class EString; 10 11 12 class Log 13 : public Garbage 14 { 15 public: 16 enum Severity { Debug, Info, Significant, Error, Disaster }; 17 18 Log(); 19 Log( Log * ); 20 void log( const EString &, Severity = Info ); 21 EString id(); 22 23 Log * parent() const; 24 bool isChildOf( Log * ) const; 25 26 static void setLogLevel( Severity ); 27 static const char * severity( Severity ); 28 static bool disastersYet(); 29 30 private: 31 EString ide; 32 uint children; 33 Log * p; 34 }; 35 36 37 void log( const EString &, Log::Severity = Log::Info ); 38 39 40 #endif 41