DM-1168 spdlogging
Created by: mchorazak
Issue
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: -- Mainfilewriterlogger
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 #ifdef
s 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