python日志格式化程序,它以多行日志消息和trackback为前缀。

multiline-log-formatter的Python项目详细描述


python日志格式化程序,它以多行日志消息和trackback为前缀。使日志更具可读性 回溯和多行日志消息。

  • 免费软件:BSD许可证

基准

针对内置格式化程序logging.formatter中的pythons的基准测试。使用pytest基准完成基准测试, 下面的结果是在一个失败的新MacBookPro上运行,使用Python2.7。

应该注意的是,我们使用stringio作为流输出,因此我们应该期望结果更接近 更多类似于产品的设置,例如写入光盘。

python-redis-lock flow diagram

安装

pip install multiline-log-formatter

用法

将此添加到dictconfig:

'formatters':{'default':{'()':'multiline_formatter.formatter.MultilineMessagesFormatter','format':'[%(levelname)s] %(message)s'},},

日志消息如下:

[ERROR] LOGGING_MESSAGE ... (49564:MainThread)
... (49564:MainThread) : Traceback (most recent call last):
... (49564:MainThread) :   File "/Users/plauri/work/opensource/python-multiline-log-formatter/tests/test_multiline_formatter.py", line 112, in test_exception
... (49564:MainThread) :     raise Exception('EXCEPTION_MESSAGE')
... (49564:MainThread) : Exception: EXCEPTION_MESSAGE

如果不喜欢默认值,可以通过扩展multileMessageFormatter对其进行自定义 多行标记。您也可以更改多行fmt,但请确保在格式化过程中包含%(消息)s。 弦。

开发

要运行所有测试,请运行:

tox

其他

这个项目sceleton是由ionelmc的pylibrarycookiecutter生成的。

更改日志

0.1.8(2016-01-15)

  • pypi上的第一个版本。

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

推荐PyPI第三方库


热门话题
java Spring引导类NotFoundException EmbeddedServletContainerCustomizer   java osgi安全模型是如何工作的?   java在双链表中迭代?   (JAVA)使用命令提示符创建。来自多个服务器的jar文件。类文件   Java处理在使用线程时不显示内容   java不休眠SessionFactory。openSession()等待数据库连接从池中可用   MySQL Java Bukkit插件从数据库中选择   java如何使用CharSequence   java如何在Spring MVC REST中为JSON设置contentlength?   java在现有SOAP web服务上构建REST包装器   java Vertx NetServer控制读取流   Linux下的C++全局java语言   java我可以使用数组。用2d数组填充?如果是,我该怎么做?   java如何在google应用程序引擎的日志中显示UTF8字符?