Last active
October 15, 2019 05:52
-
-
Save yitian134/eabed6ebde0769f0827897cc5e39e07a to your computer and use it in GitHub Desktop.
[python] code snippet common used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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