Organise logging functionality under one roof.
More...
#include <bayeux/datatools/logger.h>
Organise logging functionality under one roof.
◆ priority
Priority levels for logging from most to least critical.
Enumerator |
---|
PRIO_ALWAYS | Always print the message.
|
PRIO_UNDEFINED | Undefined/invalid priority.
|
PRIO_FATAL | A fatal error. The application will most likely terminate. This is the highest priority.
|
PRIO_CRITICAL | A critical error. The application might not be able to continue running successfully.
|
PRIO_ERROR | An error. An operation did not complete successfully, but the application as a whole is not affected.
|
PRIO_WARNING | A warning. An operation completed with an unexpected result.
|
PRIO_NOTICE | A notice, which is an information with just a higher priority.
|
PRIO_INFORMATION | An informational message, usually denoting the successful completion of an operation.
|
PRIO_DEBUG | A debugging message.
|
PRIO_TRACE | A tracing message. This is the lowest priority.
|
◆ declare_ocd_logging_configuration()
◆ extract_logging_configuration()
return the priority level from a collection of properties The following properties are recognized: logging.priority : string = "fatal" # or "trace", "debug",
"information", "notice",
"warning", "error", "critical"
Shortcuts to activate some specific priorities: a) logging.debug : boolean = 1 debug : boolean = 1 is equivalent to : logging.priority : string = "debug"
b) logging.verbose : boolean = 1 verbose : boolean = 1 is equivalent to : logging.priority : string = "notice"
Note that the "logging.priority" property has precedence on "logging.debug" (or "debug") and "logging.verbose" or ("verbose").
- Parameters
-
config_ | a collection of properties to be searched |
default_prio_ | the default logging priority threshold |
throw_on_error_ | is true, an invalid logging priority label triggers an exception |
- Returns
- the priority as configured from the properties
◆ get_priority()
static priority datatools::logger::get_priority |
( |
const std::string & |
name | ) |
|
|
static |
return priority enumeration value from string The string can take three forms for matching, e.g. the PRIO_FATAL priority would be returned from input strings "PRIO_FATAL", "FATAL" or "fatal".
- Parameters
-
- Returns
- the matching priority enumeration or the PRIO_UNDEFINED if the name is not valid
◆ get_priority_label()
static std::string datatools::logger::get_priority_label |
( |
priority |
p_ | ) |
|
|
static |
return priority label from the priority enumeration value
- Parameters
-
- Returns
- the matching priority label or the empty string if the priority is not valid
◆ is_critical()
static bool datatools::logger::is_critical |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the critical level
- Parameters
-
- Returns
- true if the priority is at least at the critical level
◆ is_debug()
static bool datatools::logger::is_debug |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the debug level
- Parameters
-
- Returns
- true if the priority is at least at the debug level
◆ is_error()
static bool datatools::logger::is_error |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the error level
- Parameters
-
- Returns
- true if the priority is at least at the error level
◆ is_fatal()
static bool datatools::logger::is_fatal |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the fatal level
- Parameters
-
- Returns
- true if the priority is at least at the fatal level
◆ is_information()
static bool datatools::logger::is_information |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the information level
- Parameters
-
- Returns
- true if the priority is at least at the information level
◆ is_notice()
static bool datatools::logger::is_notice |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the notice level
- Parameters
-
- Returns
- true if the priority is at least at the notice level
◆ is_trace()
static bool datatools::logger::is_trace |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the trace level
- Parameters
-
- Returns
- true if the priority is at least at the trace level
◆ is_undefined()
static bool datatools::logger::is_undefined |
( |
priority |
p_ | ) |
|
|
static |
check if priority is defined
- Parameters
-
- Returns
- true if the priority is undefined
◆ is_warning()
static bool datatools::logger::is_warning |
( |
priority |
p_ | ) |
|
|
static |
check if priority satisfy the warning level
- Parameters
-
- Returns
- true if the priority is at least at the warning level
The documentation for this struct was generated from the following file: