CepGen 1.2.5
Central exclusive processes event generator
|
General purposes logger. More...
#include <CepGen/Utils/Logger.h>
Public Types | |
enum class | Level { nothing = 0 , error , warning , information , debug , debugInsideLoop } |
Logging threshold for the output stream. More... | |
typedef std::unique_ptr< std::ostream, std::function< void(std::ostream *)> > | StreamHandler |
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. | |
typedef std::unique_ptr<std::ostream, std::function<void(std::ostream*)> > StreamHandler |
|
strong |
void addExceptionRule | ( | const std::string & | rule | ) |
[in] | rule | Regex rule to handle |
Definition at line 37 of file Logger.cpp.
|
static |
Definition at line 31 of file Logger.cpp.
bool isTTY | ( | ) | const |
Definition at line 65 of file Logger.cpp.
Logger::StreamHandler & output | ( | ) |
Definition at line 58 of file Logger.cpp.
bool passExceptionRule | ( | const std::string & | tmpl, |
const Level & | lev | ||
) | const |
[in] | tmpl | Module name to probe |
[in] | lev | Upper verbosity level |
Definition at line 41 of file Logger.cpp.
void setOutput | ( | std::ostream * | os | ) |
Definition at line 56 of file Logger.cpp.