跳转到主要内容

MozLog与日志模块

项目描述

mozlogging:MozLog与日志模块
========================================

.. image:: https://img.shields.io/pypi/v/mozlogging.svg
:target: https://pypi.python.org/pypi/mozlogging

.. image:: https://img.shields.io/pypi/l/mozlogging.svg
:target: https://pypi.python.org/pypi/mozlogging

.. image:: https://img.shields.io/pypi/wheel/mozlogging.svg
:target: https://pypi.python.org/pypi/mozlogging

.. image:: https://img.shields.io/pypi/pyversions/mozlogging.svg
:target: https://pypi.python.org/pypi/mozlogging


示例

.. code-block:: python

>>> import logging
>>> from mozlogging import MozLogFormatter
>>> logger = logging.getLogger('example')
>>> handler = logging.StreamHandler()
>>> handler.setFormatter(MozLogFormatter())
>>> logger.addHandler(handler)
>>> logger.error({'dict': 1, 'of': 2, 'fields': 3}, 'my.message.type')
{"EnvVersion": "2.0", "Fields": {"dict": 1, "fields": 3, "of": 2}, "Logger": "example", "Severity": 3, "Timestamp": 1489366186847323648, "Type": "my.message.type"}


项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源代码发行版

mozlogging-0.1.0.tar.gz (2.5 kB 查看散列)

上传时间 源代码

构建发行版

mozlogging-0.1.0-py3-none-any.whl (4.0 kB 查看哈希值)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面