|
ACTS
Experiment-independent tracking
|
Functions and classes to manage logging failure thresholds.
Generally, log levels in ACTS are only of informative value: even Acts::Logging::Level::ERROR and Acts::Logging::Level::FATAL will only print messages, and not terminate execution.
This is desirable in an experiment context, where jobs should not immediately terminate when ACTS encounters something that is logged as an error. In a test context, however, this behavior is not optimal: the tests should ensure in known configurations errors do not occur, or only in specific circumstances. To solve this, ACTS implements an optional log threshold mechanism.
The threshold mechanism is steered via two CMake options: ACTS_ENABLE_LOG_FAILURE_THRESHOLD and ACTS_LOG_FAILURE_THRESHOLD. Depending on their configuration, the logging can operate in three modes:
Classes | |
| class | Acts::Logging::ScopedFailureThreshold |
| Helper class that changes the failure threshold for the duration of its lifetime. More... | |
| class | Acts::Logging::ThresholdFailure |
| Custom exception class so threshold failures can be caught. More... | |
Functions | |
| Level | Acts::Logging::getFailureThreshold () |
| Get debug level above which an exception will be thrown after logging. | |
| void | Acts::Logging::setFailureThreshold (Level level) |
| Set debug level above which an exception will be thrown after logging. | |
| Level Acts::Logging::getFailureThreshold | ( | ) |
Get debug level above which an exception will be thrown after logging.
All messages with a debug level equal or higher than the return value of this function will cause an exception to be thrown after log emission.
ACTS_ENABLE_LOG_FAILURE_THRESHOLD and ACTS_LOG_FAILURE_THRESHOLD, this operations is either constexpr or a runtime operation. | void Acts::Logging::setFailureThreshold | ( | Level | level | ) |
Set debug level above which an exception will be thrown after logging.
All messages with a debug level equal or higher than level will cause an exception to be thrown after log emission.
ACTS_LOG_FAILURE_THRESHOLD is unset, i.e. no compile-time threshold is used. Otherwise an exception is thrown. | level | Log level above which exceptions will be thrown |