logzero
Robust and effective logging for Python 2 and 3.
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.
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.
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:
Documentation: https://logzero.readthedocs.io.
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
Easier usage of custom log handlers (currently works like this)
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)
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logzero-1.1.2.tar.gz.
File metadata
- Download URL: logzero-1.1.2.tar.gz
- Upload date:
- Size: 117.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54021c5b010a5871fc498be0e15730fe1024596e117712d1f388408719eb653c
|
|
| MD5 |
fc4344f0f2af093e73bdc39d8b42b37e
|
|
| BLAKE2b-256 |
a5b48392e33eeab67cded014c3806c4b7ceff2bd7f54b31446612db3f0da47fa
|
File details
Details for the file logzero-1.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: logzero-1.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfd80ee1ea43f2b52b7a9ed2f63877e44599067ff7bf59d7e92fcbf64078a938
|
|
| MD5 |
00900bbfd7fd57ae6474ddd0d60aac38
|
|
| BLAKE2b-256 |
eff45a28c3e7b66c6b30705ceacd8ff60a73b2c8dacf46add920ba387392acef
|