Skip to content

Instantly share code, notes, and snippets.

@thiborose
Last active January 20, 2022 18:35
Show Gist options
  • Select an option

  • Save thiborose/d5201d9d43182a2f34361d0bf75ec603 to your computer and use it in GitHub Desktop.

Select an option

Save thiborose/d5201d9d43182a2f34361d0bf75ec603 to your computer and use it in GitHub Desktop.
# set up logging
logging_level = logging.DEBUG if args.debug else logging.INFO
logging.basicConfig(
level=logging_level,
format="[%(asctime)s:%(module)s:%(levelname)s] %(message)s",
handlers=[
logging.FileHandler("logs.txt"),
logging.StreamHandler(sys.stdout)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment