抄写日志编写器和日志处理程序。

scribe_logger的Python项目详细描述


Build StatusCode ClimateCoverage StatusLicenseDownloads

划线记录器

此软件包包含一个低级别接口,用于向Scribe写入 以及一个更高级的日志处理程序,它与python的 伐木设施。

Supports Python 2.7

安装

pip install scribe-logger

本地测试

git clone https://github.com/adilansari/python-scribe-logger.git
cd python-scribe-logger
pip install -U -r requirements.txt
python runtests.py

记录器使用

fromscribe_logger.loggerimportScribeLogHandlerimportloggingmy_logger=logging.getLogger('MyLogger')my_logger.setLevel(logging.DEBUG)scribe=ScribeLogHandler('localhost',1464,category='test_category')scribe.setLevel(logging.DEBUG)my_logger.addHandler(scribe)my_logger.info('This is a test message')

Exceptions are suppressed by default. 使用silent=false提升它们:

scribe=ScribeLogHandler('localhost',1464,category='test_category',silent=False)

写入程序用法

fromscribe_logger.writerimportScribeWriterwriter=ScribeWriter('localhost',1464,'test_category')try:writer.write('test_message_1')writer.write(['test_message_1','test_message_2','test_message_3'])exceptScribeLoggerError:raise

Exceptions are raised by default. 使用silent=true抑制它们:

writer=ScribeWriter('localhost',1464,'test_category',silent=True)writer.write('test_message_1')writer.write(['test_message_1','test_message_2','test_message_3'])

贡献者

@adilansari@mwhoker@lennx

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java是否在servlet中检索上一页路径?   Java抱怨在开关的默认情况下未初始化最终字段   Java泛型:为什么编译器不能判断这个类<t>对象与这个类的类型参数的对象的类具有相同的类型?   Java:继承方法中使用的私有变量   HibernateJava。ClassCastException:java。lang.Integer不能强制转换为abc。def。我的项目。奥姆。EmployeeTopMetaData   http java发布和下载文件   java改进条件检查   java如何将2d数组的条目作为键放在地图中   java如何获取传递给运行时的值。getRuntime。JUnit测试用例中的exit(value)   java注释来创建所有可能的构造函数   自动建议列表:java。lang.IllegalArgumentException:在XPath表达式为null时找不到元素   为什么MapAPI在Java中不提供流功能?   gradle不导入本地java库   尽管我使用的是SessionCreationPolicy,java Spring安全性似乎仍在使用会话。无国籍   使用java查找MongoDB中数组元素的平均值