OFFIS DCMTK  Version 3.6.0
loglevel.h
Go to the documentation of this file.
1 // Module: Log4CPLUS
2 // File: loglevel.h
3 // Created: 6/2001
4 // Author: Tad E. Smith
5 //
6 //
7 // Copyright 2001-2009 Tad E. Smith
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 
25 #ifndef LOG4CPLUS_LOGLEVEL_HEADER_
26 #define LOG4CPLUS_LOGLEVEL_HEADER_
27 
28 #include "dcmtk/oflog/config.h"
29 #include "dcmtk/oflog/streams.h"
30 #include "dcmtk/oflog/tstring.h"
31 
32 //#include <vector>
33 
34 namespace log4cplus {
35 
43  typedef int LogLevel;
44 
48  const LogLevel OFF_LOG_LEVEL = 60000;
49 
53  const LogLevel FATAL_LOG_LEVEL = 50000;
54 
58  const LogLevel ERROR_LOG_LEVEL = 40000;
59 
63  const LogLevel WARN_LOG_LEVEL = 30000;
64 
69  const LogLevel INFO_LOG_LEVEL = 20000;
70 
74  const LogLevel DEBUG_LOG_LEVEL = 10000;
75 
79  const LogLevel TRACE_LOG_LEVEL = 0;
80 
84  const LogLevel ALL_LOG_LEVEL = TRACE_LOG_LEVEL;
85 
90  const LogLevel NOT_SET_LOG_LEVEL = -1;
91 
92 
99  typedef log4cplus::tstring (*LogLevelToStringMethod)(LogLevel);
100 
107  typedef LogLevel (*StringToLogLevelMethod)(const log4cplus::tstring&);
108 
109 
110 
124  class LOG4CPLUS_EXPORT LogLevelManager {
125  public:
126  LogLevelManager();
127  ~LogLevelManager();
128 
136  log4cplus::tstring toString(LogLevel ll) const;
137 
145  LogLevel fromString(const log4cplus::tstring& s) const;
146 
154  void pushToStringMethod(LogLevelToStringMethod newToString);
155 
163  void pushFromStringMethod(StringToLogLevelMethod newFromString);
164 
165  private:
166  // Data
167  void* toStringMethods;
168  void* fromStringMethods;
169 
170  // Disable Copy
172  LogLevelManager& operator=(const LogLevelManager&);
173  };
174 
178  LOG4CPLUS_EXPORT LogLevelManager& getLogLevelManager();
179 
180 }
181 
182 
183 #endif // LOG4CPLUS_LOGLEVEL_HEADER_
184 
const LogLevel TRACE_LOG_LEVEL
The TRACE_LOG_LEVEL LogLevel is used to "trace" entry and exiting of methods.
Definition: loglevel.h:79
const LogLevel OFF_LOG_LEVEL
The OFF_LOG_LEVEL LogLevel is used during configuration to turn off logging.
Definition: loglevel.h:48
LOG4CPLUS_EXPORT LogLevelManager & getLogLevelManager()
Returns the singleton LogLevelManager.
const LogLevel INFO_LOG_LEVEL
The INFO_LOG_LEVEL LogLevel designates informational messages that highlight the progress of the appl...
Definition: loglevel.h:69
const LogLevel NOT_SET_LOG_LEVEL
The NOT_SET_LOG_LEVEL LogLevel is used to indicated that no particular LogLevel is desired and that t...
Definition: loglevel.h:90
const LogLevel ALL_LOG_LEVEL
The ALL_LOG_LEVEL LogLevel is used during configuration to turn on all logging.
Definition: loglevel.h:84
const LogLevel FATAL_LOG_LEVEL
The FATAL_LOG_LEVEL LogLevel designates very severe error events that will presumably lead the applic...
Definition: loglevel.h:53
const LogLevel ERROR_LOG_LEVEL
The ERROR_LOG_LEVEL LogLevel designates error events that might still allow the application to contin...
Definition: loglevel.h:58
log4cplus::tstring(* LogLevelToStringMethod)(LogLevel)
This method type defined the signature of methods that convert LogLevels into strings.
Definition: loglevel.h:99
int LogLevel
Defines the minimum set of priorities recognized by the system, that is FATAL_LOG_LEVEL, ERROR_LOG_LEVEL, WARN_LOG_LEVEL, INFO_LOG_LEVEL, DEBUG_LOG_LEVEL, and TRACE_LOG_LEVEL.
Definition: loglevel.h:43
This class is used to "manage" LogLevel definitions.
Definition: loglevel.h:124
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
LogLevel(* StringToLogLevelMethod)(const log4cplus::tstring &)
This method type defined the signature of methods that convert strings into LogLevels.
Definition: loglevel.h:107
const LogLevel WARN_LOG_LEVEL
The WARN_LOG_LEVEL LogLevel designates potentially harmful situations.
Definition: loglevel.h:63
const LogLevel DEBUG_LOG_LEVEL
The DEBUG_LOG_LEVEL LogLevel designates fine-grained informational events that are most useful to deb...
Definition: loglevel.h:74


Generated on Wed Dec 14 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.11