Open bspot opened 3 months ago
on the one hand this is semi-documented:
on the other you just opened my eyes to a bug in one of my own applications that is based on this behaviour :D.
i will see if i can do anything about this.
In fact this will probably be a pretty common issue if you want to have a low log level for your dependencies as default and raise it to debug/trace for the application/lib you are currently developing.
How to reproduce:
At least
env_logger
supports setting a higher log level for some module than the default level:In this case,
log::max_level()
will be set to the default level:This means that the directive for
my_module
will effectively be ignored. Debug messages from that module will not be output.How to solve:
I don't believe there is a general way to fix this, since the
log::Log
trait does not provide a way to find out the max level for the logger.An individual application can solve it by setting
log::set_max_level(Trace)
after initializing the log bridge at the cost of somewhat increased overhead.However, it might be a good idea to explain this in the documentation.