Luiza  v03-01
Public Member Functions | List of all members
streamlog::logscope Class Reference

#include <logscope.h>

Public Member Functions

 logscope (logstream &ls)
 
 ~logscope ()
 
void setName (const std::string name)
 
template<class T >
void setLevel ()
 
void setLevel (const std::string &level)
 

Detailed Description

Helper class to change the current scope name and log level - if the object goes out of scope, e.g. at the end of the method where it is instantiated scope name and log level will be reset to the values they had previously, i.e. before changed through this object.
Example:

 streamlog::logscope scope( streamlog::out ) ;
 scope.setName( "TrackFitter" ) ;
 scope.setLevel< streamlog::MESSAGE3 >() ;
Author
F. Gaede, DESY
Version
Id
logscope.h,v 1.2 2007-07-13 11:09:04 gaede Exp

Constructor & Destructor Documentation

streamlog::logscope::logscope ( logstream ls)
inline

Instantiate a scope object for the given logstream.

streamlog::logscope::~logscope ( )
inline

Reset old name and level if set through this object.

References streamlog::logstream::prefix(), and streamlog::logstream::setLevel().

Member Function Documentation

template<class T >
void streamlog::logscope::setLevel ( )
inline
void streamlog::logscope::setLevel ( const std::string &  level)
inline

Change current log level for the lifetime of this object through a string level name that has been registered with the logstream via logstream::addLevelName - otherwise the call will have no effect.

References streamlog::logstream::setLevel().

void streamlog::logscope::setName ( const std::string  name)
inline

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