Hey,
I'm configuring my logger with a configuration dict which also sets the default level of my sinks to INFO. But at a later time, I'd like to be able to lower the level to DEBUG or one of my custom log levels for example.
As far as I'm aware of, there's no such way to do so at the moment. Is that correct?
You are correct. I think this is similar to what I discussed a few days ago here: https://github.com/Delgan/loguru/issues/51#issuecomment-478752897
There is actually no way to update a handler once it has been added. It is a deliberate choice in order to keep a minimal API.
You could remove() your INFO handler and re-add() it with a DEBUG level. Alternatively, you could use the filter argument to provide a function dynamically filtering logs based on their level. Check the comment I linked for some code samples, and tell me if that solves your issue. 馃憤
Most helpful comment
You are correct. I think this is similar to what I discussed a few days ago here: https://github.com/Delgan/loguru/issues/51#issuecomment-478752897
You could
remove()yourINFOhandler and re-add()it with aDEBUGlevel. Alternatively, you could use thefilterargument to provide a function dynamically filtering logs based on their level. Check the comment I linked for some code samples, and tell me if that solves your issue. 馃憤