New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use enum class for log level for type safety #1794
Comments
This is an api breaking change so can be considered only for next major version (2.x). |
While breaking API in this area, could we consider making it a little more flexible and allow user defined levels? Personally, I don't like too many levels and existing ones are fine... But it could make adapting spdlog into existing solutions much easier. |
I just want to point out, if this is done there should be way to define its own |
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: