Skip to main content

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"}


Project details


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)

Uploaded Source

Built Distribution

mozlogging-0.1.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page