Skip to content

Instantly share code, notes, and snippets.

@WritingPanda
Created December 27, 2022 21:33
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 WritingPanda/c255a169f8cd8ad4c0a094b25ef1efe0 to your computer and use it in GitHub Desktop.
Save WritingPanda/c255a169f8cd8ad4c0a094b25ef1efe0 to your computer and use it in GitHub Desktop.
Basic Configuration for logging in Python
import logging
logging.basicConfig(
filename='application.log',
level=logging.WARNING,
format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment