General purpose message logger. More...
#include <include/CepGen/Utils/Logger.h>
Public Types | |
enum class | Level { nothing = 0 , error , warning , information , debug , debugInsideLoop } |
Logging threshold for the output stream. More... | |
using | StreamHandler = std::unique_ptr<std::ostream, std::function<void(std::ostream*)> > |
Public Member Functions | |
void | addExceptionRule (const std::string &rule) |
Add a new rule to display exceptions/messages. | |
const std::vector< std::regex > & | exceptionRules () const |
Collection of logging exceptions. | |
bool | passExceptionRule (const std::string &tmpl, const Level &lev) const |
Is the module set to be displayed/logged? | |
Level | level () const |
Logging threshold. | |
void | setLevel (Level level) |
Set the logging threshold. | |
bool | extended () const |
Also show extended information? | |
void | setExtended (bool ext=true) |
Set the extended information flag. | |
bool | isTTY () const |
Is the stream handled a TTY-like stream? | |
StreamHandler & | output () |
Output stream to use for all logging operations. | |
void | setOutput (std::ostream *) |
Set the output stream. | |
Static Public Member Functions | |
static Logger & | get (std::ostream *=nullptr) |
Retrieve the running instance of the logger. | |
using StreamHandler = std::unique_ptr<std::ostream, std::function<void(std::ostream*)> > |
|
strong |
void addExceptionRule | ( | const std::string & | rule | ) |
[in] | rule | Regex rule to handle |
|
static |
bool isTTY | ( | ) | const |
StreamHandler & output | ( | ) |
bool passExceptionRule | ( | const std::string & | tmpl, |
const Level & | lev ) const |
[in] | tmpl | Module name to probe |
[in] | lev | Upper verbosity level |
void setOutput | ( | std::ostream * | ) |