Logging API module
Log operations.
Classes
- class arcstk::v_1_0_0::Appender
- A named logging output channel.
- class arcstk::v_1_0_0::Log
- A single logging operation of a Logger using a specified LOGLEVEL.
- class arcstk::v_1_0_0::Logger
- Logs a message to its registered Appenders.
- class arcstk::v_1_0_0::Logging
- A singleton interface used by all Log instances.
Enums
Functions
- auto now_time() -> std::string
- Returns the current time in the format
'YYYY-MM-DD hh:mm:ss.lll'
.
Variables
- const int LOGLEVEL_MAX
- Numeric representation of the maximum legal loglevel.
- const int LOGLEVEL_MIN
- Numeric representation of the minimal legal loglevel.
Defines
- #define ARCS_LOG(loglevel)
- Send log message with specified log level to log.
- #define ARCS_LOG_DEBUG
- Send debug message to log.
- #define ARCS_LOG_ERROR
- Send error message to log.
- #define ARCS_LOG_INFO
- Send info message to log.
- #define ARCS_LOG_WARNING
- Send warning message to log.
- #define CLIP_LOGGING_LEVEL
- Clipping for the log level.
Enum documentation
enum class LOGLEVEL: int16_t
#include <logging.hpp>
Range of log levels.
The loglevels are totally ordered in ascending order of verbosity starting on the value 0 that represents the level where nothing is logged at all.
Function documentation
std::string now_time()
#include <logging.hpp>
Returns the current time in the format 'YYYY-MM-DD hh:mm:ss.lll'
.
Returns | The current time as a string |
---|
Returns the current time as a string containing year, month, day, hours, minutes, seconds and milliseconds in the format 'YYYY-MM-DD hh:mm:ss.lll'.
Variable documentation
const int LOGLEVEL_MAX
#include <logging.hpp>
Numeric representation of the maximum legal loglevel.
const int LOGLEVEL_MIN
#include <logging.hpp>
Numeric representation of the minimal legal loglevel.
Define documentation
#define ARCS_LOG(loglevel)
#include <logging.hpp>
Send log message with specified log level to log.
Parameters | |
---|---|
loglevel | The LOGLEVEL to use |
The loglevel must be specified without the prefix LOGLEVEL::
.
This is useful for custom log levels beyond DEBUG
#define ARCS_LOG_DEBUG
#include <logging.hpp>
Send debug message to log.
#define ARCS_LOG_ERROR
#include <logging.hpp>
Send error message to log.
#define ARCS_LOG_INFO
#include <logging.hpp>
Send info message to log.
#define ARCS_LOG_WARNING
#include <logging.hpp>
Send warning message to log.
#define CLIP_LOGGING_LEVEL
#include <logging.hpp>
Clipping for the log level.
Every message that has not at least the CLIP_LOGGING_LEVEL is immediatly discarded.
Since this is a compile-time constant, the optimizer will recognize any comparison loglevel == LOG_NONE and remove the statement in question entirely. (See the definition of the ARCS_LOG_* macros to inspect how the clipping level is checked.)