Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::ErrorHandler Class Reference

#include <elm/util/ErrorHandler.h>

Public Member Functions

virtual void onError (error_level_t level, const string &message)
 
virtual ~ErrorHandler ()
 

Static Public Member Functions

static cstring getLevelString (error_level_t level)
 

Static Public Attributes

static ErrorHandler DEFAULT
 
static ErrorHandler STD
 

Detailed Description

An error handler allows to get control on the production of error message. The onError() methods must be overload by subclassing this class and the obtained object must be passed to the ErrorBase that generates the error messages.

Author
H. Cassé casse.nosp@m.@iri.nosp@m.t.fr

Constructor & Destructor Documentation

virtual elm::ErrorHandler::~ErrorHandler ( )
virtual

Member Function Documentation

cstring elm::ErrorHandler::getLevelString ( error_level_t  level)
static

Get a string representing the supplied error level.

Parameters
levelError level to get string of.
Returns
Matching string.

Referenced by onError().

void elm::ErrorHandler::onError ( error_level_t  level,
const string message 
)
virtual

This method is called each time an error message is generated. As a default, it display the error on standard error output.

Parameters
levelLevel of the error.
messageMessage to display.

This method may be called by the class inheriting from ErrorHandler . This event will be transmitted to the error handler. to generate an error event.

Parameters
levelLevel of the error event.
messageMessage of the error event.

References elm::cerr, elm::io::endl, and getLevelString().

Referenced by elm::ErrorBase::onError().

Member Data Documentation

ErrorHandler elm::ErrorHandler::DEFAULT
static

Default error handler.

ErrorHandler elm::ErrorHandler::STD
static

The documentation for this class was generated from the following files: