#include <logscope.h>
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 |
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 >() ;