Skip to content

Instantly share code, notes, and snippets.

@Kif11
Last active January 14, 2023 18:09
Show Gist options
  • Save Kif11/d6d1aba377bc05fc7d60bf9549eab62d to your computer and use it in GitHub Desktop.
Save Kif11/d6d1aba377bc05fc7d60bf9549eab62d to your computer and use it in GitHub Desktop.
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