Level Class Reference

Inheritance diagram for Level:

Inheritance graph
[legend]
Collaboration diagram for Level:

Collaboration graph
[legend]
List of all members.

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

const LevelPtrtoLevel (const String &sArg)
const LevelPtrtoLevel (int val)
const LevelPtrtoLevel (int val, const LevelPtr &defaultLevel)
const LevelPtrtoLevel (const String &sArg, const LevelPtr &defaultLevel)

Static Public Attributes

const LevelPtr ALL
const LevelPtr FATAL
const LevelPtr ERROR
const LevelPtr WARN
const LevelPtr INFO
const LevelPtr DEBUG
const LevelPtr OFF

Detailed Description

Defines the minimum set of levels recognized by the system, that is OFF, FATAL, ERROR, WARN, INFO, DEBUG and ALL.

The Level class may be subclassed to define a larger level set.


Constructor & Destructor Documentation

Level int  level,
const String &  levelStr,
int  syslogEquivalent
 

Instantiate a Level object.


Member Function Documentation

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.

int toInt  )  const [virtual]
 

Returns the integer representation of this level.

const LevelPtr & toLevel const String &  sArg,
const LevelPtr defaultLevel
[static]
 

Convert the string passed as argument to a level. If the conversion fails, then this method returns the value of defaultLevel.

const LevelPtr & toLevel int  val,
const LevelPtr defaultLevel
[static]
 

Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.

const LevelPtr & toLevel int  val  )  [static]
 

Convert an integer passed as argument to a level. If the conversion fails, then this method returns DEBUG.

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 String & toString  )  const [virtual]
 

Returns the string representation of this priority.


Member Data Documentation

const LevelPtr ALL [static]
 

The ALL level designates all the levels

const LevelPtr DEBUG [static]
 

The DEBUG level designates fine-grained informational events that are most useful to debug an application.

const LevelPtr ERROR [static]
 

The ERROR level designates error events that might still allow the application to continue running.

const LevelPtr FATAL [static]
 

The FATAL level designates very severe error events that will presumably lead the application to abort.

const LevelPtr INFO [static]
 

The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.

const LevelPtr OFF [static]
 

The OFF level designates not set level

const LevelPtr WARN [static]
 

The WARN level designates potentially harmful situations.


The documentation for this class was generated from the following files:
  • level.h
  • level.cpp

Copyright © 1999-2004, Apache Software Foundation