-
I'm having issues using multiple sinks, with different levels, in one logger (using the default logger in general as well as the logger itself). Using the examples from the wiki - I put the code below together... When testing the logger with the included sinks, neither message prints out. To either the console or the file. From what I've read, I am under the impression that this should at least print out in the console, right? I recently added the preprocessor definition at the top to try to set a baseline level... it's not doing much. This is being called by another file in the same project, would that cause any issues?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
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 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); |
Beta Was this translation helpful? Give feedback.
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
tospdlog::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);