Python的RotatingFileHandler的Bug
2014-03-07 00:09
706 查看
Python的库非常强大,基本能找到我们所有需要的lib。logging模块是Python中的日志记录库,借鉴了Java中的LOG4J模块的思想,能非常方便的用于记录软件执行日志。最近有在开发自动化测试工具,刚好需要logging模块,但在使用logging模块的RotatingFileHandler时,常抛出异常。打印类似于如下异常信息:http://www.44342.com/python-f871-t33115-p1.htm
_acquireLock() try:#unlikelytoraiseanexception,butyouneverknow... del_handlers[self] _handlerList.remove(self) finally: _releaseLock() #修改为: _acquireLock() try:#unlikelytoraiseanexception,butyouneverknow... #del_handlers[self] if(_handlers.has_key(self)):del_handlers[self] #if(selfin_handlerList):_handlerList.remove(self) _handlerList.remove(self) finally: _releaseLock()ViewCode原始讨论来自:
相关文章推荐
- Python logging RotatingFileHandler bug
- Python logging RotatingFileHandler bug
- python logging类库中RotatingFileHandler的使用
- python logging现学现用 – TimedRotatingFileHandler使用方法
- python日志按时间切分-----TimedRotatingFileHandler
- Python多进程不要使用TimedRotatingFileHandler
- python logging 模块之TimedRotatingFileHandler 实现每天一个日志文件
- [bigdata-078] python3 logging 的示例 TimedRotatingFileHandler和RotatingFileHandler 基于时间切分和基于文件大小切分
- 实际应用中遇到TimedRotatingFileHandler不滚动的问题
- Django开发模式会加载两次settings文件导致RotatingFileHandlerError
- python的BaseHTTPRequestHandler的bug
- [Python--]tornado.web.StaticFileHandler 实现文件下载
- TimedRotatingFileHandler
- python自身bug:file.tell()在Linux和window平台下返回不同的值
- logging TimedRotatingFileHandler不支持多进程
- 使用py2exe 将python文件转成exe文件(以及 error: [Errno 2] No such file or directory: 'MSVCP90.dll'解决方法)
- Insert Element In XML File by Python xml.etree.ElementTree Module
- 8: Importing A File(Command line Python scripting)
- python No handlers could be found for logger错误的解决
- 使用patch修补python中serial.tools中的一个Bug