Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python basic logging boilerplate for console log
import logging
log = logging.getLogger()
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
log.addHandler(handler)
log.setLevel(logging.INFO)
log.info('Hello World!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment