iSpike  2.1
Spike conversion library for robotics
D:/Home/Programs/iSpike/include/iSpike/Log/Log.hpp
Go to the documentation of this file.
00001 #ifndef LOG_HPP_
00002 #define LOG_HPP_
00003 
00004 //Other includes
00005 #include <string>
00006 #include <iostream>
00007 #include <sstream>
00008 using namespace std;
00009 
00013 enum TLogLevel {
00014         LOG_EMERGENCY, LOG_ALERT, LOG_CRITICAL, LOG_ERROR,
00015         LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG
00016 };
00017 
00018 #define LOG(level) \
00019         if (level > Log::ReportingLevel()) ; \
00020         else Log().Get(level)
00021 
00022 namespace ispike {
00023 
00025         class Log {
00026                 public:
00027                         Log();
00028                         virtual ~Log();
00029                         ostringstream& Get(TLogLevel level = LOG_DEBUG);
00030                         static TLogLevel& ReportingLevel();
00031                         static int currentId;
00032 
00033                 protected:
00034                         ostringstream os;
00035 
00036 
00037                 private:
00038                         Log(const Log&);
00039                         Log& operator =(const Log&);
00040                         string logLevelToString(TLogLevel level);
00041         };
00042 
00043 }
00044 
00045 
00046 #endif /* LOG_HPP_ */
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines