Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#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 & | NO_INFO = NO_INFO_HANDLER |
static ErrorHandler & | QUIET = QUIET_HANDLER |
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.
|
inlinevirtual |
|
static |
Get a string representing the supplied error level.
level | Error level to get string of. |
Referenced by ErrorHandler::onError().
|
virtual |
This method is called each time an error message is generated. As a default, it display the error on standard error output.
level | Level of the error. |
message | Message 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.
level | Level of the error event. |
message | Message of the error event. |
Reimplemented in QuietHandler, and NoInfoHandler.
References elm::cerr, elm::io::endl, and ErrorHandler::getLevelString().
Referenced by ErrorBase::onError(), and NoInfoHandler::onError().
|
static |
Default error handler that displays to standard error output the messages it gets.
|
static |
Error handler that displays all except the information messages.
|
static |
Error handler that does not display anything.