Public Member Functions | |
Level (int level, const String &levelStr, int syslogEquivalent) | |
virtual bool | equals (const LevelPtr &level) const |
virtual int | getSyslogEquivalent () const |
virtual bool | isGreaterOrEqual (const LevelPtr &level) const |
virtual const String & | toString () const |
virtual int | toInt () const |
Static Public Member Functions | |
static const LevelPtr & | toLevel (const String &sArg) |
static const LevelPtr & | toLevel (int val) |
static const LevelPtr & | toLevel (int val, const LevelPtr &defaultLevel) |
static const LevelPtr & | toLevel (const String &sArg, const LevelPtr &defaultLevel) |
Static Public Attributes | |
static const LevelPtr | ALL |
static const LevelPtr | FATAL |
static const LevelPtr | ERROR |
static const LevelPtr | WARN |
static const LevelPtr | INFO |
static const LevelPtr | DEBUG |
static const LevelPtr | OFF |
OFF
, FATAL
, ERROR
, WARN
, INFO
, DEBUG
and ALL
.
The Level
class may be subclassed to define a larger level set.
const LevelPtr & toLevel | ( | const String & | sArg | ) | [static] |
Convert the string passed as argument to a level. If the conversion fails, then this method returns DEBUG.
const LevelPtr & toLevel | ( | int | val | ) | [static] |
Convert an integer passed as argument to a level. If the conversion fails, then this method returns DEBUG.
Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.
Convert the string passed as argument to a level. If the conversion fails, then this method returns the value of defaultLevel
.
bool equals | ( | const LevelPtr & | level | ) | const [virtual] |
Two levels are equal if their level fields are equal.
int getSyslogEquivalent | ( | ) | const [virtual] |
Return the syslog equivalent of this level as an integer.
bool isGreaterOrEqual | ( | const LevelPtr & | level | ) | const [virtual] |
Returns true
if this level has a higher or equal level than the level passed as argument, false
otherwise.
You should think twice before overriding the default implementation of isGreaterOrEqual
method.
const String & toString | ( | ) | const [virtual] |
Returns the string representation of this priority.
int toInt | ( | ) | const [virtual] |
Returns the integer representation of this level.
The FATAL
level designates very severe error events that will presumably lead the application to abort.
The ERROR
level designates error events that might still allow the application to continue running.
The INFO
level designates informational messages that highlight the progress of the application at coarse-grained level.
The DEBUG
level designates fine-grained informational events that are most useful to debug an application.