odygrd / quill

Asynchronous Low Latency C++ Logging Library
MIT License
1.36k stars 142 forks source link

failed to log out DEBUG level when QUILL_ROOT_LOGGER_ONLY is defined #419

Closed williamlfang closed 3 months ago

williamlfang commented 4 months ago

2024-04-13_19-12

I tried to compile file 'example_quick_start.cpp' under folder 'examles'. When macro QUILL_ROOT_LOGGER_ONLY is defined, anything of log level below DEBUG is missing. That's wired.

williamlfang commented 4 months ago

I think it's something related to quill:get_logger() or quill:get_root_logger()

odygrd commented 3 months ago

default log level is INFO you need to change it first with

quill::get_root_logger()->set_log_level(quill::LogLevel::TraceL3);

Setting the log level is the handler as you are doing in line 22 is not the same. Setting it on the handler works like a filter, it filters out the messages when they hit the handler, but those messages never make it to the handler as they are dropped by the logger