Twisted与twiggy日志库的集成。
项目描述
twixxy - twiggy + twisted
twixxy主要包括一个twisted日志观察者,可以安装到调用适当的Twiggy日志方法以将log.msg和log.err。
与twistd一起使用
twixxy提供了一个与twistd --logger兼容的日志观察者工厂。
> twistd --logger=twixxy.observerFactory -n web --path=. 2012-06-19T22:09:43Z:INFO:twisted:Log opened. 2012-06-19T22:09:43Z:INFO:twisted:twistd 12.1.0 (/Users/dreid/.virtualenvs/twixxy/bin/python 2.7.1) starting up. 2012-06-19T22:09:43Z:INFO:twisted:reactor class: twisted.internet.selectreactor.SelectReactor. 2012-06-19T22:09:43Z:INFO:twisted:Site starting on 8080 2012-06-19T22:09:43Z:INFO:twisted:Starting factory <twisted.web.server.Site instance at 0x10b718fc8>
在不使用twistd的情况下替换Twisted的日志记录
import sys import twiggy from twisted.python import log from twixxy import TwiggyLoggingObserver twiggy.quickSetup(file=sys.stdout) observer = TwiggyLoggingObserver('example') log.startLoggingWithObserver(observer.emit) log.msg('Hello, World!')
与Twisted的日志记录一起使用
import sys import twiggy from twisted.python import log from twixxy import TwiggyLoggingObserver twiggy.quickSetup(file='twiggy.log') observer = TwiggyLoggingObserver('example2') observer.start() log.startLogging(sys.stdout) log.msg('Hello, World!')
项目详情
关闭
twixxy-0.1.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9a1317932a482d95b77e799781d71cc8a8dc6a919e7b84e344b772c8aafc2020 |
|
MD5 | bf8df677201cc95ade496ec7e61980ac |
|
BLAKE2b-256 | e13c134aa01466df33d87e189e838d09e86c427b486a84741ad364c6354852ee |