python logging使用
来源:互联网 发布:excel2016数据分析在哪 编辑:程序博客网 时间:2024/05/16 12:46
#coding:utf-8
import logging
def initLogging():
logpath=”%s/log/input_version.log” %(os.getcwd())
logging.basicConfig(filename=os.path.join(os.getcwd(),logpath),
filemode=’a’,
format=’%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s %(message)s’,
datefmt=’%Y-%m-%d %H:%M:%S’,
level = logging.DEBUG)
console=logging.StreamHandler()
console.setLevel(logging.DEBUG)
formatter=logging.Formatter(‘%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s %(message)s’)
console.setFormatter(formatter)
logging.getLogger(”).addHandler(console)
参考:http://blog.csdn.net/azhao_dn/article/details/7320186
0 0
- Python Logging使用
- python logging使用
- python的logging使用
- python logging使用
- Python的logging使用
- python logging的使用
- 使用Python的logging.config
- 使用Python的logging.config
- 使用python的logging模块
- 使用python的logging模块
- 使用python的logging模块
- 【python系列】logging的使用
- 使用python的logging模块
- 使用python的logging模块
- python logging 简单使用总结
- 使用python的logging模块
- 使用python的logging模块
- Python的Logging使用教程
- 第十五周--阅读程序
- AJAX
- Flatten Binary Tree to Linked List
- JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period
- Spring官方文档学习(0)
- python logging使用
- 关于响应式布局
- 透明度百分比与十六进制之间的转换
- 2分钟读懂Hadoop和Spark的异同
- Jquery实现Cookie操作
- pycharm 快捷键
- iOS 第三方框架-Masonry 的视图模块化
- python set
- Android-view事件传递机制