Last active
August 29, 2015 14:19
-
-
Save mbr/6afa28c8b9f0b71d4cf4 to your computer and use it in GitHub Desktop.
Example taken from the logbook docs, not working as of 0.9.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://pythonhosted.org/Logbook/api/handlers.html#logbook.Handler | |
# | |
# > By default messages sent to that handler will not go to a handler on an | |
# > outer level on the stack, if handled. This can be changed by setting | |
# > bubbling to True. This setup for example would not have any effect: | |
# > | |
# > handler = NullHandler(bubble=True) | |
# > handler.push_application() | |
# > | |
# > Whereas this setup disables all logging for the application: | |
# > | |
# > handler = NullHandler() | |
# > handler.push_application() | |
# | |
# The small script below tries to recreate the example minimally as accurate | |
# as possible: | |
from logbook import NullHandler, critical | |
handler = NullHandler(bubble=True) | |
handler.push_application() | |
critical('sample message, should bubble') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment