Closed a-cristi closed 3 years ago
Yeah you are right, this is confusing.
So what you would want is a more verbose output, the more verbose the log level is. I have touched this part of the code a few times to much to have ended up at this kinda broken state. I will fix this with 0.10.0 today.
After getting back to this, I am pretty sure, that this is expected behavior. As I said:
So what you would want is a more verbose output, the more verbose the log level is.
Which is what the current settings do. Reversing this for config options, leads to enabling more information for less frequent errors. I think the typical use case is not to log the file and line number only on errors and warnings, but on debug and trace statements.
So the documentation is off.
I hope d1e80a2c6669c28e9809dd7d952fdeee0da7fd5c makes that a little clearer. Feel free to reopen, if you have any better suggestions.
I think it's ok now. Thank you! :)
Either that, or I'm confused by the documentation.
For example, the documentation for
set_max_level
states that:Looking at the
LevelFilter
I have the impression thatOff
is the lowest level, whileTrace
is the highest, soset_max_level(Trace)
should enable this for all levels. However, it seems to work in reverse.This outputs:
Setting the
LevelFilter
toError
display the level every time:The same is true for all other options. I'm not sure if this is a bug, because there seems to be a consistency between all the
set_
methods, but things are not working as documented. This is especially confusing because theLevelFilter
forinit
works as documented: if I changeTermLogger::init(LevelFilter::Trace
toTermLogger::init(LevelFilter::Warn
I'm seeing onlyWarn
andError
messages.I'm also not sure about
set_thread_mode
which seems to behave a bit weird in regards toThreadLogMode::Names
:This logs the thread IDs, but does not log the names. Using
set_thread_level(LevelFilter::Trace)
seems to have the same problem as the one described above.Again, I'm not sure if this is a bug, or I'm simply misunderstanding the documentation.