Closed llchan closed 1 week ago
I'd rather steer clear of introducing preprocessor directives to alter the library's behavior. It took considerable effort to eliminate them in the latest version, and they aren't compatible with C++ modules. The only area where I'm permitting their use in the library is LogMacros.h
, since even with modules, it must be included due to its macro content.
This has been done in master as runtime, it doesn't seem to have any noticeable difference in performance.
For example:
quill::BackendOptions backend_options;
backend_options.log_level_descriptions[static_cast<uint32_t>(quill::LogLevel::Warning)] = "WARN";
quill::Backend::start(backend_options);
Yep runtime works too if it's now exposed in v5.0.0, thanks! 👍🏼
Yes it is included in v5.0
It would be useful to be able to define something like
-DQUILL_LOG_LEVEL_NAME_DEBUG=DBG
to customize the log level names. Compile-time constants are good enough, no need for runtime configurability as that may incur additional overhead.