18 #ifndef _LOG4CXX_LEVEL_H 19 #define _LOG4CXX_LEVEL_H 28 #pragma warning ( push ) 29 #pragma warning ( disable: 4251 ) 43 typedef std::shared_ptr<Level>
LevelPtr;
63 return LOG4CXX_STR(
"Level");
87 int syslogEquivalent);
94 static LevelPtr toLevel(
const std::string& sArg);
103 static LevelPtr toLevel(
const std::string& sArg,
104 const LevelPtr& defaultLevel);
109 void toString(std::string& name)
const;
111 #if LOG4CXX_WCHAR_T_API 117 static LevelPtr toLevel(
const std::wstring& sArg);
126 static LevelPtr toLevel(
const std::wstring& sArg,
127 const LevelPtr& defaultLevel);
132 void toString(std::wstring& name)
const;
134 #if LOG4CXX_UNICHAR_API 140 static LevelPtr toLevel(
const std::basic_string<UniChar>& sArg);
149 static LevelPtr toLevel(
const std::basic_string<UniChar>& sArg,
150 const LevelPtr& defaultLevel);
155 void toString(std::basic_string<UniChar>& name)
const;
157 #if LOG4CXX_CFSTRING_API 173 const LevelPtr& defaultLevel);
185 static LevelPtr toLevelLS(
const LogString& sArg);
194 static LevelPtr toLevelLS(
const LogString& sArg,
195 const LevelPtr& defaultLevel);
206 static LevelPtr toLevel(
int val);
212 static LevelPtr toLevel(
int val,
const LevelPtr& defaultLevel);
227 static void initializeLevels();
228 static LevelPtr getAll();
229 static LevelPtr getFatal();
230 static LevelPtr getError();
231 static LevelPtr getWarn();
232 static LevelPtr getInfo();
233 static LevelPtr getDebug();
234 static LevelPtr getTrace();
235 static LevelPtr getOff();
241 virtual bool equals(
const LevelPtr& level)
const;
245 return (this->level == level1.level);
250 return (this->level != level1.level);
258 return syslogEquivalent;
271 virtual bool isGreaterOrEqual(
const LevelPtr& level)
const;
283 static volatile bool initialized;
284 static std::mutex initMutex;
285 static LevelPtr allLevel;
286 static LevelPtr fatalLevel;
287 static LevelPtr errorLevel;
288 static LevelPtr warnLevel;
289 static LevelPtr infoLevel;
290 static LevelPtr debugLevel;
291 static LevelPtr traceLevel;
292 static LevelPtr offLevel;
296 int syslogEquivalent;
303 #define DECLARE_LOG4CXX_LEVEL(level)\ 305 class Class##level : public Level::LevelClass\ 308 Class##level() : Level::LevelClass() {}\ 309 virtual LogString getName() const { return LOG4CXX_STR(#level); } \ 310 virtual LevelPtr toLevel(const LogString& sArg) const\ 311 { return level::toLevelLS(sArg); }\ 312 virtual LevelPtr toLevel(int val) const\ 313 { return level::toLevel(val); }\ 315 DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level) 317 #define IMPLEMENT_LOG4CXX_LEVEL(level) \ 318 IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level) 320 #if defined(_MSC_VER) 321 #pragma warning (pop) 324 #endif //_LOG4CXX_LEVEL_H #define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:153
LevelClass()
Definition: level.h:59
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:147
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
static LevelPtr toLevel(const std::string &sArg)
Convert the string passed as argument to a level.
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:141
virtual LevelPtr toLevel(const LogString &sArg) const
Definition: level.h:66
const struct __CFString * CFStringRef
Definition: logstring.h:36
static LevelPtr toLevelLS(const LogString &sArg)
Convert the string passed as argument to a level.
base class for java-like objects.
Definition: object.h:101
bool operator!=(const Level &level1) const
Definition: level.h:248
int getSyslogEquivalent() const
Return the syslog equivalent of this level as an integer.
Definition: level.h:256
#define DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(object, class)
Definition: object.h:56
int toInt() const
Returns the integer representation of this level.
Definition: level.h:277
virtual LevelPtr toLevel(int val) const
Definition: level.h:71
Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR, WARN, INFO, DEBUG and ALL.
Definition: level.h:53
Definition: appender.h:32
virtual LogString getName() const
Definition: level.h:61
std::basic_string< logchar > LogString
Definition: logstring.h:66
bool operator==(const Level &level1) const
Definition: level.h:243