20{
21 spdlog::set_level(spdlog::level::off);
22
23
24 auto dupFilter = std::make_shared<spdlog::sinks::dup_filter_sink_mt>(std::chrono::seconds(
LOG_FILTER_SECS));
25 if (getppid() != 1)
26 {
27 dupFilter->add_sink(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
28 }
29 dupFilter->add_sink(std::make_shared<spdlog::sinks::syslog_sink_mt>(PROJECT_NAME, LOG_USER, 0, false));
30 dupFilter->add_sink(std::make_shared<spdlog::sinks::loki_api_sink_mt>(lokiAddr));
31 dupFilter->add_sink(std::make_shared<spdlog::sinks::sentry_api_sink_mt>(sentryAddr));
32
33
34 _mainLogger = std::make_shared<spdlog::logger>(PROJECT_NAME, dupFilter);
35
38
39#ifdef NDEBUG
40 spdlog::set_level(spdlog::level::warn);
41#else
42 spdlog::set_level(spdlog::level::info);
43#endif
44
45 PRINT_VERSION();
46}
constexpr int LOG_FILTER_SECS
constexpr int LOG_FLUSH_SECS
std::shared_ptr< spdlog::logger > _mainLogger