Created
October 20, 2016 11:46
-
-
Save adejones/8286d5350bcd48fa925532b48f785536 to your computer and use it in GitHub Desktop.
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 | |
# change default log entry format, set filename and logging level | |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s", filename="example.log") | |
logging.info("Started") | |
logging.info("This is an example entry") | |
logging.debug("This line won't get logged as the log level is INFO") | |
logging.info("Done.") | |
# perform an orderly shutdown by flushing and closing all handlers; called at application exit and no further use of the logging system should be made after this call. | |
logging.shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment