18 #ifndef _LOG4CXX_LEVEL_H 19 #define _LOG4CXX_LEVEL_H 27 #pragma warning ( push ) 28 #pragma warning ( disable: 4251 ) 42 typedef std::shared_ptr<Level>
LevelPtr;
62 return LOG4CXX_STR(
"Level");
86 int syslogEquivalent);
93 static LevelPtr toLevel(
const std::string& sArg);
102 static LevelPtr toLevel(
const std::string& sArg,
103 const LevelPtr& defaultLevel);
108 void toString(std::string& name)
const;
110 #if LOG4CXX_WCHAR_T_API 116 static LevelPtr toLevel(
const std::wstring& sArg);
125 static LevelPtr toLevel(
const std::wstring& sArg,
126 const LevelPtr& defaultLevel);
131 void toString(std::wstring& name)
const;
133 #if LOG4CXX_UNICHAR_API 139 static LevelPtr toLevel(
const std::basic_string<UniChar>& sArg);
148 static LevelPtr toLevel(
const std::basic_string<UniChar>& sArg,
149 const LevelPtr& defaultLevel);
154 void toString(std::basic_string<UniChar>& name)
const;
156 #if LOG4CXX_CFSTRING_API 172 const LevelPtr& defaultLevel);
184 static LevelPtr toLevelLS(
const LogString& sArg);
193 static LevelPtr toLevelLS(
const LogString& sArg,
194 const LevelPtr& defaultLevel);
205 static LevelPtr toLevel(
int val);
211 static LevelPtr toLevel(
int val,
const LevelPtr& defaultLevel);
226 static void initializeLevels();
227 static LevelPtr getAll();
228 static LevelPtr getFatal();
229 static LevelPtr getError();
230 static LevelPtr getWarn();
231 static LevelPtr getInfo();
232 static LevelPtr getDebug();
233 static LevelPtr getTrace();
234 static LevelPtr getOff();
240 virtual bool equals(
const LevelPtr& level)
const;
244 return (this->level == level1.level);
249 return (this->level != level1.level);
257 return syslogEquivalent;
270 virtual bool isGreaterOrEqual(
const LevelPtr& level)
const;
282 static volatile bool initialized;
283 static std::mutex initMutex;
284 static LevelPtr allLevel;
285 static LevelPtr fatalLevel;
286 static LevelPtr errorLevel;
287 static LevelPtr warnLevel;
288 static LevelPtr infoLevel;
289 static LevelPtr debugLevel;
290 static LevelPtr traceLevel;
291 static LevelPtr offLevel;
295 int syslogEquivalent;
302 #define DECLARE_LOG4CXX_LEVEL(level)\ 304 class Class##level : public Level::LevelClass\ 307 Class##level() : Level::LevelClass() {}\ 308 virtual LogString getName() const { return LOG4CXX_STR(#level); } \ 309 virtual LevelPtr toLevel(const LogString& sArg) const\ 310 { return level::toLevelLS(sArg); }\ 311 virtual LevelPtr toLevel(int val) const\ 312 { return level::toLevel(val); }\ 314 DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level) 316 #define IMPLEMENT_LOG4CXX_LEVEL(level) \ 317 IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS(level, Class##level) 319 #if defined(_MSC_VER) 320 #pragma warning (pop) 323 #endif //_LOG4CXX_LEVEL_H #define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:148
LevelClass()
Definition: level.h:58
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:142
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:136
virtual LevelPtr toLevel(const LogString &sArg) const
Definition: level.h:65
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:247
int getSyslogEquivalent() const
Return the syslog equivalent of this level as an integer.
Definition: level.h:255
#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:276
virtual LevelPtr toLevel(int val) const
Definition: level.h:70
Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR, WARN, INFO, DEBUG and ALL.
Definition: level.h:52
Definition: appender.h:32
virtual LogString getName() const
Definition: level.h:60
std::basic_string< logchar > LogString
Definition: logstring.h:66
bool operator==(const Level &level1) const
Definition: level.h:242