Skip to content

Instantly share code, notes, and snippets.

@mtalimanchuk
Created April 24, 2021 01:51
Show Gist options
  • Save mtalimanchuk/0c8622822739633083c6b2972a066209 to your computer and use it in GitHub Desktop.
Save mtalimanchuk/0c8622822739633083c6b2972a066209 to your computer and use it in GitHub Desktop.
Minimal logging setup to configure a standalone logger
import logging
logger = logging.getLogger("Logger name")
handler = logging.StreamHandler()
handler.setFormatter(
logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
)
logger.addHandler(handler)
logger.setLevel("INFO")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment