MozLog with the logging Module
Project description
mozlogging: MozLog with the logging Module
========================================
.. 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
Example:
.. 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"}
========================================
.. 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
Example:
.. 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"}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mozlogging-0.1.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for mozlogging-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fc3d520a17b048c8723abdba19f6c01f2bcaf4182944aaac5906f28bd5b7d77 |
|
MD5 | b3e49840ce3fa1974c87c19144f61a98 |
|
BLAKE2b-256 | 7fba22ce0c6292629b15a8a4104a3adcb14044099d3afe2a98ceb7743f5dc1d6 |