Can I add a new Log-Level? #2703
-
I just discovered this library and I want to integrate it into oure project. I asked myself if it possible to add a new log level, which I then can use like the default log-levels (like so When it is possible, I would also have to adjust the hierarchic of log levels, maybe add a custom color and probably add many more things, which I currently cannot imagine. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you want to add an API to the Any log level that is printed in the log message can be overridden by the macro. spdlog/include/spdlog/tweakme.h Lines 103 to 114 in ad0e89c I'm not exactly sure what "adjust the hierarchic of log levels" means, but if you want to change the behavior when comparing log levels, change the number assigned to the log level. spdlog/include/spdlog/common.h Lines 198 to 222 in ad0e89c See #2279 how to set up custom colors. |
Beta Was this translation helpful? Give feedback.
If you want to add an API to the
spdlog
namespace, you have to edit the source files.Any log level that is printed in the log message can be overridden by the macro.
spdlog/include/spdlog/tweakme.h
Lines 103 to 114 in ad0e89c