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

enum class LOGLEVEL: int16_t { NONE = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, DEBUG1 = 5, DEBUG2 = 6, DEBUG3 = 7, DEBUG4 = 8 }
Range of log levels.

Functions

auto api_version_is_at_least(const int major, const int minor, const int patch) -> bool
Compares specified version to actual version.
auto now_time() -> std::string
Returns the current time in the format 'YYYY-MM-DD hh:mm:ss.lll'.

Variables

const std::string LIBARCSTK_GIT_VERSION
Version info as shown by git describe --always HEAD.
const std::string LIBARCSTK_NAME
Library name.
const std::string LIBARCSTK_VERSION
Complete semantic version information.
const int LIBARCSTK_VERSION_MAJOR
Major version number.
const int LIBARCSTK_VERSION_MINOR
Minor version number.
const int LIBARCSTK_VERSION_PATCH
Patch level.
const std::string LIBARCSTK_VERSION_SUFFIX
Version suffix (e.g. 'alpha.1', 'beta.6', 'rc.3' etc.).
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

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

bool api_version_is_at_least(const int major, const int minor, const int patch)

Compares specified version to actual version.

Parameters
major in Major version number to test
minor in Minor version number to test
patch in Patch level number to test
Returns TRUE if actual version is at least specified version

std::string now_time()

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 std::string LIBARCSTK_GIT_VERSION

Version info as shown by git describe --always HEAD.

const std::string LIBARCSTK_NAME

Library name.

const std::string LIBARCSTK_VERSION

Complete semantic version information.

const int LIBARCSTK_VERSION_MAJOR

Major version number.

const int LIBARCSTK_VERSION_MINOR

Minor version number.

const int LIBARCSTK_VERSION_PATCH

Patch level.

const std::string LIBARCSTK_VERSION_SUFFIX

Version suffix (e.g. 'alpha.1', 'beta.6', 'rc.3' etc.).

const int LOGLEVEL_MAX

Numeric representation of the maximum legal loglevel.

const int LOGLEVEL_MIN

Numeric representation of the minimal legal loglevel.

Define documentation

#define ARCS_LOG(loglevel)

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

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.

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.)