Skip to content

DM-1168 spdlogging

Afonso Mukai requested to merge DM-1168_spdlogging_2 into master

Created by: mchorazak

Issue

DM-1168

Closes #415 Closes #328

Description of work

Overview

  • instead of spdlog and graylog separately, we are now using spdlog with graylog sink plugin, credits to @rerpha
  • Instead of using a macro, each class holds a shared_ptr to logger instance.
  • Some free functions simply call spdlog::get("filewriterlogger") if they are unlikely to be used frequently, otherwise a shared pointer is passed as an argument.
  • Logger always prints to console, optionally can also save logs to file and/or send to graylog.
  • In UnitTests.cpp there are two loggers set up: -- Main filewriterlogger displaying messages from filewriter. It is turned off by default. -- testlogger that displays only messages from tests.

Graylog/no graylog?

Filewriter works also with plain spdlog package. In this case #ifdefs in the code prevent from using graylog functionality. To avoid accidental changes that would break the code for those not using graylog, a new jenkins job is set up that tests the code against conanfile with basic spdlog package.

Nominate for Group Code Review

  • Nominate for code review

Merge request reports