log4shib 2.0.1
Loading...
Searching...
No Matches
Priority.hh
Go to the documentation of this file.
1/*
2 * Priority.hh
3 *
4 * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5 * Copyright 2000, Bastiaan Bakker. All rights reserved.
6 *
7 * See the COPYING file for the terms of usage and distribution.
8 */
9
10#ifndef _LOG4SHIB_PRIORITY_HH
11#define _LOG4SHIB_PRIORITY_HH
12
14#include <string>
15#include <stdexcept>
16
17/*
18 * Optionally work around rudeness in windows.h on Win32.
19 */
20#ifdef ERROR
21#ifdef LOG4SHIB_FIX_ERROR_COLLISION
22
23namespace log4shib {
24 static const int _tmpERRORValue = ERROR;
25}
26
27#undef ERROR
28 static const int ERROR = log4shib::_tmpERRORValue;
29#define ERROR ERROR
30
31#else // LOG4SHIB_FIX_ERROR_COLLISION
32#error Naming collision for 'ERROR' detected. Please read the FAQ for a \
33 workaround.
34#endif // LOG4SHIB_FIX_ERROR_COLLISION
35
36#endif // ERROR
37
38/*
39 * Other Win32 rudeness in EDK.h
40 */
41#ifdef DEBUG
42
43#ifdef LOG4SHIB_FIX_ERROR_COLLISION
44
45#undef DEBUG
46#define DEBUG DEBUG
47
48#else // LOG4SHIB_FIX_ERROR_COLLISION
49#error Naming collision for 'DEBUG' detected. Please read the FAQ for a \
50 workaround.
51#endif // LOG4SHIB_FIX_ERROR_COLLISION
52
53#endif // DEBUG
54
55
56namespace log4shib {
57
63 public:
64
69 typedef enum {EMERG = 0,
70 FATAL = 0,
71 ALERT = 100,
72 CRIT = 200,
73 ERROR = 300,
74 WARN = 400,
75 NOTICE = 500,
76 INFO = 600,
77 DEBUG = 700,
78 NOTSET = 800
79 } PriorityLevel;
80
84 typedef int Value;
85
94 static const std::string& getPriorityName(int priority) throw();
95
105 static Value getPriorityValue(const std::string& priorityName);
106 };
107}
108
109#endif // _LOG4SHIB_PRIORITY_HH
#define LOG4SHIB_EXPORT
Definition Export.hh:11
The Priority class provides importance levels with which one can categorize log messages.
Definition Priority.hh:62
@ EMERG
Definition Priority.hh:69
@ WARN
Definition Priority.hh:74
@ NOTSET
Definition Priority.hh:78
@ ERROR
Definition Priority.hh:73
@ FATAL
Definition Priority.hh:70
@ ALERT
Definition Priority.hh:71
@ DEBUG
Definition Priority.hh:77
@ CRIT
Definition Priority.hh:72
@ NOTICE
Definition Priority.hh:75
@ INFO
Definition Priority.hh:76
int Value
The type of Priority Values.
Definition Priority.hh:84
static const std::string & getPriorityName(int priority)
Returns the name of the given priority value.
Definition Priority.cpp:23
static Value getPriorityValue(const std::string &priorityName)
Returns the value of the given priority name.
Definition Priority.cpp:30
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16