Skip to content

Instantly share code, notes, and snippets.

@yitian134
Last active October 15, 2019 05:52
Show Gist options
  • Save yitian134/eabed6ebde0769f0827897cc5e39e07a to your computer and use it in GitHub Desktop.
Save yitian134/eabed6ebde0769f0827897cc5e39e07a to your computer and use it in GitHub Desktop.
[python] code snippet common used
# coding=utf-8
import logging
import os
import sys
reload(sys)
sys.setdefaultencoding("utf8")
# logging 文件配置
file_basename = os.path.basename(__file__)
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(filename)s:%(lineno)d %(levelname)s %(message)s',
filename=file_basename + '.log',
filemode='a')
logging.info("test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment