#include <ScopedLog.h>
Contains options for prefix and postfix, log and annotate, to support when and where to print. It also supports a log level, note to print for Pip, and selector id to print to.
Common usage:
void fn() { static const log_id_t lid = Log::getId("global::fn"); ScopedLog sl("function fn", 0, lid, true, true, true, false); // do some work. }
Definition at line 73 of file ScopedLog.h.
Public Member Functions | |
ScopedLog (const std::string &_note, log_level_t _level, log_id_t _logId, bool _prefix, bool _suffix, bool _log, bool _annotate) | |
constructs a new scoped log obejct |
ScopedLog::ScopedLog | ( | const std::string & | _note, | |
log_level_t | _level, | |||
log_id_t | _logId, | |||
bool | _prefix, | |||
bool | _suffix, | |||
bool | _log, | |||
bool | _annotate | |||
) | [inline] |
constructs a new scoped log obejct
_note | A Pip-only description of what starting and endings are being logged | |
_level | The log level to pass to the log class | |
_logId | The log selector id to use for logging | |
_prefix | Whether to log in the constructor | |
_suffix | Whether to log in the destructor | |
_log | Whether to log to the log class | |
_annotate | Whether to use Pip annotations |
Definition at line 85 of file ScopedLog.h.
References ANNOTATE_GET_PATH_ID(), ANNOTATE_NOTICE(), ANNOTATE_PUSH_PATH_ID(), ANNOTATE_START_TASK(), Log::binaryLog(), Log::endl, Log::getId(), and Log::log().