-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silencing loguru logger #97
Comments
Hi Falko, thank you for opening the issue. Logging has not been refactored completely yet
There are the following ways to silence it:
from loguru import logger
logger.remove()
logger.add(sys.stderr, filter="bfabric", level="WARNING", colorize=False)
|
But this is from their docs, they say we should just disable logging in the library and make it opt in for applications # For libraries, should be your library's `__name__`
logger.disable("my_library")
logger.info("No matter added sinks, this message is not displayed")
# In your application, enable the logger in the library
logger.enable("my_library")
logger.info("This message however is propagated to the sinks") The only reason I am a bit hesitant to have no logging by default, is that I then expect logging messages to not be available in general. You could also take the |
I've created a short section in the documentation on the logger: https://fgcz.github.io/bfabricPy/good_to_know/#logging-level It can be refined later if necessary. |
Hi @leoschwarz
I have been using bfabricpy2 for a few weeks now. Awesome work! I was able to get rid of quite some redundant code on my end.
But one question: is there a way to completely silence the loguru logging? I would have expected verbose=False to do the trick, but it seems to only affect messages on top of what loguru already outputs.
Thanks in advance.
All the best,
Falko
The text was updated successfully, but these errors were encountered: