Skip to main content

Python logging made easy

Project description

logzero

https://img.shields.io/pypi/v/logzero.svg https://img.shields.io/travis/metachris/logzero.svg Documentation Status Updates

Robust and effective logging for Python 2 and 3.

Logo

Features

  • Easy logging to console and/or file.

  • Provides a fully configured standard Python logger object.

  • 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.

  • No further Python dependencies.

  • Licensed under the MIT license.

  • Heavily inspired by the Tornado web framework.

Demo output in color

Example Usage

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:

Installation

Install logzero with pip:

$ pip install -U logzero

Changelog

See the changelog here: https://github.com/metachris/logzero/blob/master/HISTORY.rst

Future Features & Ideas

Notes: How to release a new version

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

# Run the tests
py.test
make lint

# Update history
vi HISTORY.rst
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."

# Update version
bumpversion minor

# Push
git push && git push --tags

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

1.1.2 (2017-07-04)

  • Better reconfiguration of handlers, doesn’t remove custom handlers anymore

1.1.0 (2017-07-03)

  • Bugfix: Disabled color logging to logfile

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.

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

logzero-1.1.2.tar.gz (117.4 kB view hashes)

Uploaded Source

Built Distribution

logzero-1.1.2-py2.py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 2 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