Wolf logging macro
Notice: This PR is only about simple wolf logging macro as described below and do not implement any data logging as this topic as to be discussed. A data logging draft class is implemented on branch wolf_data_logging.
Enable logging macro using third-party spdlog (MIT license) :
WOLF_INFO
WOLF_WARN
WOLF_ERROR
-
WOLF_DEBUG
(enabled only if compiled in debug) -
WOLF_TRACE
(which is the same as WOLF_DEBUG_HERE but enabled/disabled at compile time)
Trace logging is enabled/disabled from the src/CMakeLists.txt
option
option(_WOLF_TRACE "Enable wolf tracing macro" OFF)
test_wolf_logging.cpp
shows the following:
WOLF_INFO("test info ", 5, " ", 0.123);
WOLF_WARN("test warn ", 5, " ", 0.123);
WOLF_ERROR("test error ", 5, " ", 0.123);
WOLF_TRACE("test trace ", 5, " ", 0.123);
WOLF_DEBUG("test debug ", 5, " ", 0.123);
Which, full feature enabled, produces :
The log pattern is :
[thread id][hour:min:sec.nanosec][log type] log-content
The TRACE
log pattern is :
[thread id][hour:min:sec.nanosec][log type][$file l#$line : $function] log-content