You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sink::set_level() expects a level argument.
Currently the levels are defined using #define and a normal enumeration.
A better way would be to use an enum class for type safety. in that case a user can't input random numbers into the function and gets more verbose help from his IDE.
The text was updated successfully, but these errors were encountered:
While breaking API in this area, could we consider making it a little more flexible and allow user defined levels?
I think that something like this was requested a few times already, like here: #834, #2279
Personally, I don't like too many levels and existing ones are fine... But it could make adapting spdlog into existing solutions much easier.
Linux traditionally uses 8 predefined levels. Google log has some severity levels, but then it has verbose logging, when log level is just any number. Etc...
bachittle
pushed a commit
to bachittle/spdlog
that referenced
this issue
Dec 22, 2022
I just want to point out, if this is done there should be way to define its own spdlog::level::level_enum. There some cases where you want to have log levels in a file without the need to include the full spdlog header (think compilation time). Currently you can just create an int enum and cast them to spdlog's enum, but when you make it a class enum that is not (easily) possible anymore.
The sink::set_level() expects a level argument.
Currently the levels are defined using #define and a normal enumeration.
A better way would be to use an enum class for type safety. in that case a user can't input random numbers into the function and gets more verbose help from his IDE.
The text was updated successfully, but these errors were encountered: