Skip to content

Instantly share code, notes, and snippets.

@foowaa
Last active December 19, 2018 07:49
Show Gist options
  • Save foowaa/4363b9e4420a431ca0a3a846646ad70f to your computer and use it in GitHub Desktop.
Save foowaa/4363b9e4420a431ca0a3a846646ad70f to your computer and use it in GitHub Desktop.
# Level: CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET
import logging
logging.basicConfig(level=logging.DEBUG,
filename="mylog.log",
format='%(asctime)s %(levelname)s %(filename)s %(funcName)s %(lineno)d %(message)s',
filemode='w')
logger = logging.getLogger(__name__)
# logging.getLogger("module_name").setLevel(logging.CRITICAL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment