Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Priority.hh

Go to the documentation of this file.
00001 /*
00002  * Priority.hh
00003  *
00004  * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
00005  * Copyright 2000, Bastiaan Bakker. All rights reserved.
00006  *
00007  * See the COPYING file for the terms of usage and distribution.
00008  */
00009 
00010 #ifndef _LOG4CPP_PRIORITY_HH
00011 #define _LOG4CPP_PRIORITY_HH
00012 
00013 #include <string>
00014 #include <stdexcept>
00015 
00016 /*
00017  * Optionally work around rudeness in windows.h on Win32.
00018  */
00019 #ifdef ERROR
00020 #ifdef LOG4CPP_FIX_ERROR_COLLISION
00021 
00022 namespace log4cpp {
00023     static const int _tmpERRORValue = ERROR;
00024 }
00025 
00026 #undef ERROR
00027     static const int ERROR = log4cpp::_tmpERRORValue;
00028 #define ERROR ERROR
00029 
00030 #else  // LOG4CPP_FIX_ERROR_COLLISION
00031 #error Naming collision for 'ERROR' detected. Please read the FAQ for a \
00032        workaround. 
00033 #endif // LOG4CPP_FIX_ERROR_COLLISION 
00034 
00035 #endif // ERROR
00036 
00037 /*
00038  * Other Win32 rudeness in EDK.h
00039  */
00040 #ifdef DEBUG
00041 
00042 #ifdef LOG4CPP_FIX_ERROR_COLLISION
00043 
00044 #undef DEBUG
00045 #define DEBUG DEBUG
00046 
00047 #else  // LOG4CPP_FIX_ERROR_COLLISION
00048 #error Naming collision for 'DEBUG' detected. Please read the FAQ for a \
00049        workaround. 
00050 #endif // LOG4CPP_FIX_ERROR_COLLISION 
00051 
00052 #endif // DEBUG
00053 
00054 
00055 namespace log4cpp {
00056 
00061     class Priority {
00062         public:
00063 
00068         typedef enum {EMERG  = 0, 
00069                       FATAL  = 0,
00070                       ALERT  = 100,
00071                       CRIT   = 200,
00072                       ERROR  = 300, 
00073                       WARN   = 400,
00074                       NOTICE = 500,
00075                       INFO   = 600,
00076                       DEBUG  = 700,
00077                       NOTSET = 800
00078         } PriorityLevel;
00079 
00083         typedef int Value;
00084 
00093         static const std::string& getPriorityName(int priority) throw();
00094         
00104         static Value getPriorityValue(const std::string& priorityName)
00105         throw(std::invalid_argument);
00106     };
00107 }
00108 
00109 #endif // _LOG4CPP_PRIORITY_HH

Generated at Mon Jan 28 01:40:21 2002 for log4cpp by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001