Changeset 128 for XMLIO_V2/dev/dev_rv/src/XMLIO/logger.hpp
- Timestamp:
- 10/11/10 16:10:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/logger.hpp
r122 r128 18 18 private : 19 19 20 ILogger( )20 ILogger(void) 21 21 { signal(SIGSEGV, SigHandler); } 22 23 private : /* static */ 22 24 23 25 static ILogger LOGGER; 24 26 25 public : 27 public : /* static */ 26 28 27 29 static ILogger& GetLogger(void) { return (ILogger::LOGGER); } 30 31 static void Flush(std::ostream& out = std::clog) 32 { ILogger::GetLogger().flush(out); } 28 33 29 34 static void ShowBTrace(std::ostream& out = std::clog) … … 63 68 } 64 69 65 ~ILogger(void) 66 { std::cout << str() << std::endl; } 70 public : 71 72 void flush(std::ostream& out = std::clog) 73 { out << str() << std::endl; str(""); } 74 75 ~ILogger(void) { this->flush(); } 67 76 68 77 }; // class XMLIOLogger … … 84 93 85 94 std::ostream& IncIndent(std::ostream& out) { Indent++; return (NIndent(out)); } 86 std::ostream& DecEndl (std::ostream& out) { Indent--; return (out); }95 std::ostream& DecEndl (std::ostream& out) { Indent--; return (out); } 87 96 ///////////////////////////////////////////////////////////////////// 88 97 89 98 } // namespace XMLIOSERVER 90 99 91 #define ERROR(MSG) (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": error : " << MSG << std::endl) 92 #define WARNING(MSG) (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": warning : " << MSG << std::endl) 93 #define INFO(MSG) (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": info : " << MSG << std::endl) 100 #define ERROR(MSG)\ 101 (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": error : " << MSG << std::endl) 102 #define WARNING(MSG)\ 103 (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": warning : " << MSG << std::endl) 104 #define INFO(MSG)\ 105 (ILogger::GetLogger() << __FILE__ << ":" << __LINE__ << ": info : " << MSG << std::endl) 94 106 // A compléter. 95 107
Note: See TracChangeset
for help on using the changeset viewer.