Skip to content

Issue with multiple sink levels in one logger #2107

Answered by tt4g
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

spdlog::logger also has log level (by default info).

https://github.com/gabime/spdlog/blob/v1.9.2/include/spdlog/logger.h#L314

No log messages will be passed to sink if they are filtered at the logger log level.

https://github.com/gabime/spdlog/blob/v1.9.2/include/spdlog/logger.h#L127-L132

You have to set log level of daq_logger to spdlog::level::trace.

     auto daq_logger = std::make_shared<spdlog::logger>("logger", begin(sinks), end(sinks));
+  daq_logger ->set_level(spdlog::level::trace);
     // don't think this is needed, but nothing will work anyway
     spdlog::register_logger(daq_logger);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ghost
Comment options

@tt4g
Comment options

@ghost
Comment options

@ghost
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant