LogContextState holds the status members of a LogContext and related behavior.
More...
#include <Logger.h>
|
| LogContextState (int level, const char *file, const char *function, int line, const char *tags=0) |
| The LogContextState constructor initializes all the static context information and also records the ID of the current thread.
|
|
bool | active () const |
| Return true if log messages from this context have been enabled.
|
|
void | setActive (bool active) |
| Enable this log point according to active .
|
|
const char * | filename () const |
|
const char * | function () const |
|
int | line () const |
|
int | level () const |
|
const char * | tags () const |
|
std::string | threadName () const |
| Return the name of the thread which created this context.
|
|
std::string | levelName () const |
|
void | log (const std::string &msg) const |
| Convenience method which writes the given message to the current Logger instance, passing this object as the LogContextState.
|
|
LogMessage | log () const |
| Return a LogMessage associated with this LogContextState, so the message will be logged through this context when the LogMessage goes out of scope.
|
|
LogContextState holds the status members of a LogContext and related behavior.
It can be copied and saved but by itself has no connection to the global log points, so it's active flag does not change except through setActive().
◆ LogContextState()
LogContextState::LogContextState |
( |
int | level, |
|
|
const char * | file, |
|
|
const char * | function, |
|
|
int | line, |
|
|
const char * | tags = 0 ) |
The LogContextState constructor initializes all the static context information and also records the ID of the current thread.
◆ active()
bool nidas::util::LogContextState::active |
( |
| ) |
const |
|
inline |
◆ filename()
const char * nidas::util::LogContextState::filename |
( |
| ) |
const |
|
inline |
◆ function()
const char * nidas::util::LogContextState::function |
( |
| ) |
const |
|
inline |
◆ level()
int nidas::util::LogContextState::level |
( |
| ) |
const |
|
inline |
◆ levelName()
std::string nidas::util::LogContextState::levelName |
( |
| ) |
const |
|
inline |
◆ line()
int nidas::util::LogContextState::line |
( |
| ) |
const |
|
inline |
◆ setActive()
void nidas::util::LogContextState::setActive |
( |
bool | active | ) |
|
|
inline |
Enable this log point according to active
.
References _active, and active().
◆ tags()
const char * nidas::util::LogContextState::tags |
( |
| ) |
const |
|
inline |
◆ threadName()
std::string LogContextState::threadName |
( |
| ) |
const |
◆ _active
bool nidas::util::LogContextState::_active |
|
protected |
◆ _file
const char* nidas::util::LogContextState::_file |
|
protected |
◆ _function
const char* nidas::util::LogContextState::_function |
|
protected |
◆ _level
int nidas::util::LogContextState::_level |
|
protected |
◆ _line
int nidas::util::LogContextState::_line |
|
protected |
◆ _tags
const char* nidas::util::LogContextState::_tags |
|
protected |
◆ _threadId
pthread_t nidas::util::LogContextState::_threadId |
|
protected |
The documentation for this class was generated from the following files: