|
versatile-mcmc
0.1.7
|
A simple MACRO-focussed logging facility. More...
#include <logger.hpp>
Classes | |
| struct | Location |
| A simple struct used by the Logger macros to pass information about the filename and line number. More... | |
Public Types | |
| enum | ELevel { Trace, Debug, Info, Warn, Error, Fatal, Undefined } |
Public Member Functions | |
| Logger (const std::string &name="") | |
| Standard constructor assigning a name to the logger instance. More... | |
| std::mutex & | GetMutex () |
| bool | IsLevelEnabled (ELevel level) const |
| Check whether a certain log-level is enabled. More... | |
| ELevel | GetLevel () const |
| Get a loggers minimum logging level. More... | |
| void | SetLevel (ELevel level) |
| Set a loggers minimum logging level. More... | |
| void | SetColoured (bool coloured) |
| Set whether the output should be coloured or not. More... | |
| void | StartMessage (ELevel level, const Location &loc=Location()) |
| Start a message with the specified level. More... | |
| std::ostream & | Log () |
| Get an output stream for log messages to append. More... | |
| void | EndMessage () |
| End and flush the last message. More... | |
A simple MACRO-focussed logging facility.
It should primarily be accessed by the user through the use of MACROs:
Available log levels are: Trace, Debug, Info, Warn, Error, Fatal
By default, if the library is compiled in release-mode, Trace and Debug outputs are silenced, as well as assertions. No external configuration mechanisms (yet).
This facility might possibly be replaced by boost log - or extended to accept user defined formatting and alternative output like log files.
| vmcmc::Logger::Logger | ( | const std::string & | name = "" | ) |
Standard constructor assigning a name to the logger instance.
| name | The logger name. |
| void vmcmc::Logger::EndMessage | ( | ) |
End and flush the last message.
Do not use directly.
|
inline |
Get a loggers minimum logging level.
|
inline |
Check whether a certain log-level is enabled.
| level | The log level as string representation. |
|
inline |
Get an output stream for log messages to append.
Do not use directly.
|
inline |
Set whether the output should be coloured or not.
| coloured |
|
inline |
Set a loggers minimum logging level.
| level | enum item identifying the log level |
Start a message with the specified level.
Do not use this method directly. Use the macro LOG(logger, level, message) instead.
| level | The log level. |
| loc | Source code location (set automatically by the corresponding macro). |
1.8.11