Description
With the PR #261, a hierarchy of levels for the different types of log messages was added in stdlib_logger
led by @wclodius2 . Currently the user can only choose a level from which all messages with a level higher than the chosen level can be written. See these specs for more details on the different levels.
During the review of the #261, @ivan-pi proposed another possibility that would consider the different levels as switches.
Usig a binary representation of integers, levels would look like:
none_level = 0
text_error_level = shiftl(1,0)
io_error_level = shiftl(1,1) ! or the error levels can have the same switch
error_level = shiftl(1,2)
warning_level = shiftl(1,3)
information_level = shiftl(1,4)
debug_level = shiftl(1,5)
all_level = text_error_level + io_error_level + error_level + warning_level + &
information_level + debug_level
This representation would allow the user to turn on selectively only certains combinations of log messages needed to be written to the output.
I often use stdlib_logger
and I am happy with the current behaviour. However, I can see the advantages of such an approach.
What do you think?