Skip to content

Instantly share code, notes, and snippets.

@vse
Created March 21, 2015 22:19
Show Gist options
  • Save vse/e6ab02db5c7f346d9d07 to your computer and use it in GitHub Desktop.
Save vse/e6ab02db5c7f346d9d07 to your computer and use it in GitHub Desktop.
log to a file
import logging
logging.basicConfig(level=logging.DEBUG, filename='/tmp/test.log')
log = logging.getLogger()
log.info("info")
log.debug("debug")
log.error("error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment