18#ifndef _LOG4CXX_LEVEL_H
19#define _LOG4CXX_LEVEL_H
38typedef std::shared_ptr<Level>
LevelPtr;
58 return LOG4CXX_STR(
"Level");
82 int syslogEquivalent);
106#if LOG4CXX_WCHAR_T_API
129#if LOG4CXX_UNICHAR_API || LOG4CXX_LOGCHAR_IS_UNICHAR
150 void toString(std::basic_string<UniChar>& name)
const;
152#if LOG4CXX_CFSTRING_API
252 return (this->level == level1.level);
257 return (this->level != level1.level);
265 return syslogEquivalent;
290 LOG4CXX_DECLARE_PRIVATE_MEMBER(
LogString, name)
292 int syslogEquivalent;
299#define DECLARE_LOG4CXX_LEVEL(level)\
301 class Class##level : public Level::LevelClass\
304 Class##level() : Level::LevelClass() {}\
305 virtual LogString getName() const { return LOG4CXX_STR(#level); } \
306 virtual LevelPtr toLevel(const LogString& sArg) const\
307 { return level::toLevelLS(sArg); }\
308 virtual LevelPtr toLevel(int val) const\
309 { return level::toLevel(val); }\
311 DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level)
313#define IMPLEMENT_LOG4CXX_LEVEL(level) \
314 IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level)
virtual LevelPtr toLevel(int val) const
Definition level.h:66
virtual LevelPtr toLevel(const LogString &sArg) const
Definition level.h:61
virtual LogString getName() const
Definition level.h:56
LevelClass()
Definition level.h:54
Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR,...
Definition level.h:49
static LevelPtr getError()
@ DEBUG_INT
Definition level.h:216
@ OFF_INT
Definition level.h:211
@ ALL_INT
Definition level.h:218
@ WARN_INT
Definition level.h:214
@ INFO_INT
Definition level.h:215
@ ERROR_INT
Definition level.h:213
@ FATAL_INT
Definition level.h:212
@ TRACE_INT
Definition level.h:217
static LevelPtr toLevel(const std::wstring &sArg, const LevelPtr &defaultLevel)
Convert the string passed as argument to a level.
static const DataPtr & getData()
static LevelPtr toLevel(const CFStringRef &sArg)
Convert the string passed as argument to a level.
static LevelPtr toLevel(int val)
Convert an integer passed as argument to a level.
static LevelPtr getWarn()
static LevelPtr getDebug()
LogString toString() const
Returns the string representation of this level.
static LevelPtr toLevel(const std::string &sArg)
Convert the string passed as argument to a level.
virtual bool equals(const LevelPtr &level) const
Two levels are equal if their level fields are equal.
bool operator!=(const Level &level1) const
Definition level.h:255
static LevelPtr getTrace()
static LevelPtr toLevel(int val, const LevelPtr &defaultLevel)
Convert an integer passed as argument to a level.
virtual bool isGreaterOrEqual(const LevelPtr &level) const
Returns true if this level has a higher or equal level than the level passed as argument,...
static LevelPtr toLevel(const std::basic_string< UniChar > &sArg, const LevelPtr &defaultLevel)
Convert the string passed as argument to a level.
void toString(std::string &name) const
Get the name of the level in the current encoding.
void toString(std::wstring &name) const
Get the name of the level.
std::shared_ptr< Data > DataPtr
Definition level.h:232
static LevelPtr toLevelLS(const LogString &sArg)
Convert the string passed as argument to a level.
static LevelPtr getInfo()
void toString(CFStringRef &name) const
Get the name of the level.
int getSyslogEquivalent() const
Return the syslog equivalent of this level as an integer.
Definition level.h:263
bool operator==(const Level &level1) const
Definition level.h:250
void toString(std::basic_string< UniChar > &name) const
Get the name of the level.
int toInt() const
Returns the integer representation of this level.
Definition level.h:284
static LevelPtr toLevel(const std::wstring &sArg)
Convert the string passed as argument to a level.
static LevelPtr getFatal()
static LevelPtr toLevel(const CFStringRef &sArg, const LevelPtr &defaultLevel)
Convert the string passed as argument to a level.
static LevelPtr toLevelLS(const LogString &sArg, const LevelPtr &defaultLevel)
Convert the string passed as argument to a level.
static LevelPtr toLevel(const std::basic_string< UniChar > &sArg)
Convert the string passed as argument to a level.
Level(int level, const LogString &name, int syslogEquivalent)
Instantiate a Level object.
base class for java-like objects.
Definition object.h:106
const struct __CFString * CFStringRef
Definition logstring.h:30
Definition propertysetter.h:27
std::basic_string< logchar > LogString
Definition logstring.h:60
std::shared_ptr< Level > LevelPtr
Definition optionconverter.h:28
#define DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(object, class)
Definition object.h:60
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:158
#define END_LOG4CXX_CAST_MAP()
Definition object.h:152
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:146
LevelPtr Debug
Definition level.h:228
LevelPtr Info
Definition level.h:227
LevelPtr All
Definition level.h:230
LevelPtr Trace
Definition level.h:229
LevelPtr Warn
Definition level.h:226
LevelPtr Off
Definition level.h:223
LevelPtr Fatal
Definition level.h:224
LevelPtr Error
Definition level.h:225