Skip to main content
=======
logzero
=======


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

.. image:: https://img.shields.io/travis/metachris/logzero.svg
:target: https://travis-ci.org/metachris/logzero

.. image:: https://readthedocs.org/projects/logzero/badge/?version=latest
:target: https://logzero.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://pyup.io/repos/github/metachris/logzero/shield.svg
:target: https://pyup.io/repos/github/metachris/logzero/
:alt: Updates


Robust and effective logging for Python 2 and 3.

.. image:: docs/_static/logo-small.png
:alt: Logo
:width: 300px

* GitHub repository: https://github.com/metachris/logzero
* Documentation: https://logzero.readthedocs.io


Features
--------

* Easy logging to console and/or file.
* Provides a fully configured standard `Python logger object <https://docs.python.org/2/library/logging.html#module-level-functions>`_.
* Pretty formatting, including level-specific colors in the console.
* Robust against str/bytes encoding problems, works with all kinds of character encodings and special characters.
* Multiple loggers can write to the same logfile (also across multiple Python files).
* Global default logger with `logzero.logger` and custom loggers with `logzero.setup_logger(..)`.
* Compatible with Python 2 and 3.
* All contained in a `single file`_.
* Licensed under the MIT license.
* Heavily inspired by the `Tornado web framework`_.


.. image:: docs/_static/demo_output.png
:alt: Demo output in color
:width: 300px


.. _single file: https://github.com/metachris/logzero/blob/master/logzero/__init__.py
.. _Tornado web framework: https://github.com/tornadoweb/tornado


Example Usage
-------------

.. code-block:: python

from logzero import logger

logger.debug("hello")
logger.info("info")
logger.warn("warn")
logger.error("error")

Take a look at the documentation for more information and examples:

* Documentation: https://logzero.readthedocs.io.


Installation
=============

Install `logzero` with `pip`_:

.. code-block:: console

$ pip install -U logzero


Future Features & Ideas
-----------------------

* Rotating Logfiles
* JSON output a la 12 factor app
* Send logs to remote log collector (maybe)
* Structured logging a la https://structlog.readthedocs.io/en/stable/index.html (maybe)


Related Projects
----------------

* https://structlog.readthedocs.io/en/stable/why.html
* https://12factor.net/logs
* fluentd, logstash


Notes
-----

* https://cookiecutter-pypackage.readthedocs.io/en/latest/pypi_release_checklist.html


Credits
---------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage



=======
History
=======

1.1.0 (2017-07-02)
------------------

* Global default logger instance (`logzero.logger`)
* Ability to reconfigure the default logger with (`logzero.setup_default_logger(..)`)
* More tests
* More documentation

1.0.0 (2017-06-27)
------------------

* Cleanup and documentation


0.2.0 (2017-06-12)
------------------

* Working logzero package with code and tests


0.1.0 (2017-06-12)
------------------

* First release on PyPI.


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

logzero-1.1.0.tar.gz (116.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

logzero-1.1.0-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file logzero-1.1.0.tar.gz.

File metadata

  • Download URL: logzero-1.1.0.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for logzero-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4a14a2d2303a5fc7d6518f6d5f6d96d9442bddbd522f92fee57e58c91822ddad
MD5 aa4c9dcbdd5000dbd56f9bb8ea6f8a0d
BLAKE2b-256 007a55224cc20e82261288ba48852ca19f09c0cce131d0fc29c61e70a8de7991

See more details on using hashes here.

File details

Details for the file logzero-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for logzero-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7f07124290ec159516f9acb9ffc70733703ce457bcdcd4882bb4f87b1855fafe
MD5 c6b89b5c61bd95e86c95f6e756ece8b5
BLAKE2b-256 b2341e2bd8a48b61909273ecb8ecaccb88ebd71ab6402ce29ee78d715e2eddeb

See more details on using hashes here.

Supported by

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