00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _LOG4CPP_PRIORITY_HH
00011 #define _LOG4CPP_PRIORITY_HH
00012
00013 #include <log4cpp/Portability.hh>
00014 #include <string>
00015 #include <stdexcept>
00016
00017
00018
00019
00020 #ifdef ERROR
00021 #ifdef LOG4CPP_FIX_ERROR_COLLISION
00022
00023 namespace log4cpp {
00024 static const int _tmpERRORValue = ERROR;
00025 }
00026
00027 #undef ERROR
00028 static const int ERROR = log4cpp::_tmpERRORValue;
00029 #define ERROR ERROR
00030
00031 #else // LOG4CPP_FIX_ERROR_COLLISION
00032 #error Naming collision for 'ERROR' detected. Please read the FAQ for a \
00033 workaround.
00034 #endif // LOG4CPP_FIX_ERROR_COLLISION
00035
00036 #endif // ERROR
00037
00038
00039
00040
00041 #ifdef DEBUG
00042
00043 #ifdef LOG4CPP_FIX_ERROR_COLLISION
00044
00045 #undef DEBUG
00046 #define DEBUG DEBUG
00047
00048 #else // LOG4CPP_FIX_ERROR_COLLISION
00049 #error Naming collision for 'DEBUG' detected. Please read the FAQ for a \
00050 workaround.
00051 #endif // LOG4CPP_FIX_ERROR_COLLISION
00052
00053 #endif // DEBUG
00054
00055
00056 namespace log4cpp {
00057
00062 class LOG4CPP_EXPORT Priority {
00063 public:
00064
00065 static const int MESSAGE_SIZE = 8;
00066
00071 typedef enum {EMERG = 0,
00072 FATAL = 0,
00073 ALERT = 100,
00074 CRIT = 200,
00075 ERROR = 300,
00076 WARN = 400,
00077 NOTICE = 500,
00078 INFO = 600,
00079 DEBUG = 700,
00080 NOTSET = 800
00081 } PriorityLevel;
00082
00086 typedef int Value;
00087
00096 static const std::string& getPriorityName(int priority) throw();
00097
00107 static Value getPriorityValue(const std::string& priorityName)
00108 throw(std::invalid_argument);
00109 };
00110 }
00111
00112 #endif // _LOG4CPP_PRIORITY_HH