Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

utils::logging Namespace Reference

Thread safe logging utilities. More...


class  utils::logging::dolog
 a dolog object collects log messages and sends it to the logger. More...

struct  utils::logging::file_listener
 a listener writing to a file. More...

class  utils::logging::listener
 a log listener receives log messages. More...

struct  utils::logging::logfunc
 the logging function object. More...

class  utils::logging::logger
 the logging object. More...

class  utils::logging::msg
 a message prepared for logging. More...

struct  utils::logging::nolog
 a dummy class with the same interface as the dolog class. More...

struct  utils::logging::ostream_listener
 a listener writing on a ostream. More...


const dologoperator<< (const dolog &l, const string &s)
 A special string logging operator. More...

template<class T> const dologoperator<< (const dolog &l, const T &val)
 The logging operator. More...

template<class T> const nologoperator<< (const nolog &l, const T &val)

Detailed Description

Thread safe logging utilities.

To start logging (i.e. that you really can see what is logged from inside the application, you must create at least one listener object. Usually you would do it via the listener<F> template class, but feel free to derive from listener by hand.

Beware, that the onMsg() method of listener objects will execute within the logging thread. Therefore you might have to do some efforts to achieve threadsafeness of your logging class.

Except for deriving from listener you would never use any of these classes directly. Use the provided macros (log, dlog, LOG, and DLOG) instead:

 log << "What the hell is going on?" << endl;
 string answer = "I don't know either.";
 dlog << "This I tell you in debug mode only." << endl;

Function Documentation

template<class T>
const nolog& operator<< const nolog   l,
const T &    val

template<class T>
const dolog& operator<< const dolog   l,
const T &    val

The logging operator.

The functionality is borrowed from the iostream library.

const dolog& operator<< const dolog   l,
const string   s

A special string logging operator.

It encloses the string into '\"' characters.

Generated on Mon Oct 22 17:03:48 2001 for rfc822 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001