constexpr LEVELS for easier custom level usage #483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage of C++20's new constexpr functionalities for easier usage of custom LEVELS!
Modified:
PULL REQUEST DESCRIPTION
Easy, but not too readable solution.
This functionality provides an easier usage of custom log levels as value can be used within switch statements.
No explicit constant is required to store & work with custom LEVEL's value.
Warning:
On the example above 'DBUG' is used as 'CHANGE_G3LOG_DEBUG_TO_DBUG' cmake option was set.
Testing
This new/modified code was covered by unit tests.
(insight) Was all tests written using TDD (Test Driven Development) style?
The CI (Windows, Linux, OSX) are working without issues.
Was new functionality documented?
The testing steps 1 - 2 below were followed
step 1
step 2: use one of these alternatives to run tests:
ctest
ctest -V
for verbose outputmake test