How to use the ERS package

The goal of the Error Reporting System is to offer tool to simplify and unify error handling and error reporting in TDAQ applications. This package can be used at different levels. At the lowest level, one can simply use the existing checking and logging macros. For error reporting one has to define specific Issue subclasses.

Basic macros

Basic ERS functionality can be exploited by using simple macros. Those macros are available simply by including the ers/ers.h header file.

Assertion Macros

The ERS package offers a set of macros to do basic checking. The behavior of these macros is defined by the implementation of the ers::fatal stream, which can be configured by the user:

Logging Macros

The ERS package offers a set of macros to do logging. Those macros construct an issue and send them to the relevant stream. For each debug and warning severity_t level there is an associated macro:

Building Custom Issues

ERS assumes that user functions should throw exceptions in case of errors. If such exceptions are instances of classes, which inherit the ers::Issue one, ERS offers different advantages in their handling:

Streams

The ERS system use the abstraction of streams to handle issues. Conceptualy, a stream is simply an object that can the user can use to send (or receive) Issues. Several streams can be associated with each severity level. If there is more then one stream defined for a certain severity then every issue will be passed sequentially to all of those stream. In the current ERS version the default configuration of the ERS streams looks like:

FAQ

What is the macro ERS_HERE?

The macro ERS_HERE is used to insert all the context information to a ers issue. When constructing an issue one should always give the macro ERS_HERE as a first parameter.
See also:
ers::Context

Generated on Thu Dec 21 16:26:02 2006 for OH User API by  doxygen 1.4.7