00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _LOG4TANGO_LEVEL_H
00029 #define _LOG4TANGO_LEVEL_H
00030
00031 #include <log4tango/Portability.hh>
00032 #include <string>
00033 #include <stdexcept>
00034
00035
00036
00037
00038 #ifdef ERROR
00039 #ifdef LOG4TANGO_FIX_ERROR_COLLISION
00040
00041 namespace log4tango {
00042 static const int _tmpERRORValue = ERROR;
00043 }
00044
00045 #undef ERROR
00046 static const int ERROR = log4tango::_tmpERRORValue;
00047 #define ERROR ERROR
00048
00049 #else // LOG4TANGO_FIX_ERROR_COLLISION
00050 #error Naming collision for 'ERROR' detected. Please read the FAQ for a \
00051 workaround.
00052 #endif // LOG4TANGO_FIX_ERROR_COLLISION
00053
00054 #endif // ERROR
00055
00056
00057
00058
00059 #ifdef DEBUG
00060
00061 #ifdef LOG4TANGO_FIX_ERROR_COLLISION
00062
00063 #undef DEBUG
00064 #define DEBUG DEBUG
00065
00066 #else // LOG4TANGO_FIX_ERROR_COLLISION
00067 #error Naming collision for 'DEBUG' detected. Please read the FAQ for a \
00068 workaround.
00069 #endif // LOG4TANGO_FIX_ERROR_COLLISION
00070
00071 #endif // DEBUG
00072
00073
00074 namespace log4tango {
00075
00076
00077
00078
00079 class LOG4TANGO_EXPORT Level
00080 {
00081 public:
00082
00086 typedef enum {
00087 OFF = 100,
00088 FATAL = 200,
00089 ERROR = 300,
00090 WARN = 400,
00091 INFO = 500,
00092 DEBUG = 600
00093 } LevelLevel;
00094
00098 typedef int Value;
00099
00108 static const std::string& get_name (Value level);
00109
00119 static Value get_value (const std::string& level_name)
00120 throw(std::invalid_argument);
00121 };
00122
00123 }
00124
00125 #endif // _LOG4TANGO_LEVEL_H