Skip to content

Instantly share code, notes, and snippets.

@kdheepak
Created September 19, 2018 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdheepak/5640ddee2c2cff4313282a5c1827c6e6 to your computer and use it in GitHub Desktop.
Save kdheepak/5640ddee2c2cff4313282a5c1827c6e6 to your computer and use it in GitHub Desktop.
import logging
log_format = (
"%(asctime)s - %(levelname)s [%(filename)s:%(lineno)d] : %(message)s"
)
logger = logging.getLogger(__name__)
s = logging.StreamHandler()
f = logging.Formatter(log_format)
s.setFormatter(f)
logger.addHandler(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment