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 


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2