Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

streamlog::logscope Class Reference

Helper class to change the current scope name and log level - if the object goes out of scope, e.g. More...

#include <logscope.h>

List of all members.

Public Member Functions

 logscope (logstream &ls)
 Instantiate a scope object for the given logstream.

 ~logscope ()
 Reset old name and level if set through this object.

void setName (const std::string name)
 Change current log scope name for the lifetime of this object.

template<class T> void setLevel ()
 Change current log level for the lifetime of this object.

void setLevel (const std::string &level)
 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.


Protected Attributes

logstream_ls
std::string _name
int _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


The documentation for this class was generated from the following file:
Generated on Mon Jan 12 09:48:59 2009 for Marlin by doxygen 1.3.5