Merge branch 'wolf_logging' into 'master'
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](https://gitlab.iri.upc.edu/mobile_robotics/wolf/blob/wolf_data_logging/src/data_logging.h). Enable logging macro using third-party [spdlog](https://github.com/gabime/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 ```cmake option(_WOLF_TRACE "Enable wolf tracing macro" OFF) ``` `test_wolf_logging.cpp` shows the following: ```cpp 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` See merge request !99
No related branches found
No related tags found
Showing
- src/CMakeLists.txt 9 additions, 1 deletionsrc/CMakeLists.txt
- src/examples/CMakeLists.txt 3 additions, 0 deletionssrc/examples/CMakeLists.txt
- src/examples/test_wolf_logging.cpp 24 additions, 0 deletionssrc/examples/test_wolf_logging.cpp
- src/internal/config.h.in 2 additions, 0 deletionssrc/internal/config.h.in
- src/logging.h 182 additions, 0 deletionssrc/logging.h
- src/singleton.h 65 additions, 0 deletionssrc/singleton.h
- third_party/spdlog/include/spdlog/async_logger.h 77 additions, 0 deletionsthird_party/spdlog/include/spdlog/async_logger.h
- third_party/spdlog/include/spdlog/common.h 143 additions, 0 deletionsthird_party/spdlog/include/spdlog/common.h
- third_party/spdlog/include/spdlog/details/async_log_helper.h 390 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/async_log_helper.h
- third_party/spdlog/include/spdlog/details/async_logger_impl.h 89 additions, 0 deletions...d_party/spdlog/include/spdlog/details/async_logger_impl.h
- third_party/spdlog/include/spdlog/details/file_helper.h 118 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/file_helper.h
- third_party/spdlog/include/spdlog/details/log_msg.h 46 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/log_msg.h
- third_party/spdlog/include/spdlog/details/logger_impl.h 298 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/logger_impl.h
- third_party/spdlog/include/spdlog/details/mpmc_bounded_q.h 172 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/mpmc_bounded_q.h
- third_party/spdlog/include/spdlog/details/null_mutex.h 45 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/null_mutex.h
- third_party/spdlog/include/spdlog/details/os.h 361 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/os.h
- third_party/spdlog/include/spdlog/details/pattern_formatter_impl.h 636 additions, 0 deletions...ty/spdlog/include/spdlog/details/pattern_formatter_impl.h
- third_party/spdlog/include/spdlog/details/registry.h 185 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/registry.h
- third_party/spdlog/include/spdlog/details/spdlog_impl.h 245 additions, 0 deletionsthird_party/spdlog/include/spdlog/details/spdlog_impl.h
- third_party/spdlog/include/spdlog/fmt/bundled/format.cc 560 additions, 0 deletionsthird_party/spdlog/include/spdlog/fmt/bundled/format.cc
Loading
Please register or sign in to comment