Overview
Python logging formatter that prefix multiline log message and trackebacks. Makes the logs more readable, both for tracebacks and for multiline log messages.
Free software: BSD license
Benchmarking
Benchmark against pythons built in formatter logging.Formatter. The benchmark is done using pytest-benchmark, and the below results is from a run on a faily new MacBook Pro, using Python 2.7.
One should note that we are using StringIO as stream output, so we should expect the results to be even closer with more production alike setup, for example writing to disc.
Installation
pip install multiline-log-formatter
Usage
Add this to dictConfig:
'formatters': {
'default': {
'()': 'multiline_formatter.formatter.MultilineMessagesFormatter',
'format': '[%(levelname)s] %(message)s'
},
},
And log messages will look like this:
[ERROR] LOGGING_MESSAGE ... (49564:MainThread)
... (49564:MainThread) : Traceback (most recent call last):
... (49564:MainThread) : File "/Users/plauri/work/opensource/python-multiline-log-formatter/tests/test_multiline_formatter.py", line 112, in test_exception
... (49564:MainThread) : raise Exception('EXCEPTION_MESSAGE')
... (49564:MainThread) : Exception: EXCEPTION_MESSAGE
And if you don’t like the default, you can customize it by extending MultilineMessagesFormatter and set multiline_marker. You can also change multiline_fmt, but assure you include %(message)s in the formating string.
Documentation
Development
To run the all tests run:
tox
Other
This project sceleton is generated by ionelmc’s pylibrary cookiecutter.
Changelog
0.1.8 (2016-01-15)
First release on PyPI.
Metadata
Release files for multiline-log-formatter 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| multiline-log-formatter-0.1.8.tar.gz | 306.6 kB | Without provenance | Details for multiline-log-formatter-0.1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| multiline_log_formatter-0.1.8-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for multiline_log_formatter-0.1.8-py2.py3-none-any.whl |
Total release size: 312.0 kB
Release files / multiline-log-formatter-0.1.8.tar.gz
| Download URL | multiline-log-formatter-0.1.8.tar.gz |
|---|---|
| Size | 306.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0889b13f6079d62fa8952f33f65c364ce0a37be5f202dc9ea3d20df137ab2151
|
|
BLAKE2b-256 checksum How to use checksums |
fd781d2b3b2223782764437a0aba6edb82e63f0fe1fb3bdbada97a7890c798ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / multiline_log_formatter-0.1.8-py2.py3-none-any.whl
| Download URL | multiline_log_formatter-0.1.8-py2.py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b0fc09278ffa79b25a036af7974bd5b42c31b1a9a09d11076245cae36048fd75
|
|
BLAKE2b-256 checksum How to use checksums |
54d39b4c66cb433963afead0528d8fc62b5c454ae0786c4bedad7a2882b981f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for multiline-log-formatter 0.1.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.