Created
January 4, 2015 05:57
-
-
Save jimjh/4c61cb6a4c47e36a0d1c to your computer and use it in GitHub Desktop.
Basic Python Logging
This file contains 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
import logging | |
def do_work(): | |
logging.debug("x") | |
if __name__ == '__main__': | |
# Register STDOUT as a log handler. | |
# There are other ways to register handlers, but this is the simplest way. | |
# See https://docs.python.org/2/library/logging.html#logging.basicConfig | |
logging.basicConfig(level=logging.DEBUG) | |
do_work() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment