Simple wrapper for CLI script which can use all advantages of structlog and can work with modules which use old good standard lib logging as well
Q Why I need it?
A Write Logs for Machines, use JSON
Usage
By default script behave like a proper 12 factor app that outputs only JSON to stdout and leave the logs of libraries that use logging unchanged
python ./examples/app.py
Boom!!!!
Bang!
Wow, exception
Traceback (most recent call last):
File "/home/mirror/PycharmProjects/structlog-boilerplate/examples/libs/sdt_lib.py", line 14, in f
1 / 0
ZeroDivisionError: division by zero
{'event': 'Boom!!!!', 'logger': 'libs.structlog_lib', 'level': 'critical', 'timestamp': '2018-11-03T09:25:19.002335Z'}
{'event': 'Bang!', 'logger': 'libs.structlog_lib', 'level': 'error', 'timestamp': '2018-11-03T09:25:19.002424Z'}
{'event': 'Wow, exception', 'logger': 'libs.structlog_lib', 'level': 'error', 'timestamp': '2018-11-03T09:25:19.002550Z', 'exception': 'Traceback (most recent call last):\n File "/home/mirror/PycharmProjects/structlog-boilerplate/examples/libs/structlog_lib.py", line 15, in f\n 1 / 0\nZeroDivisionError: division by zero'}
{"event": "result", "timestamp": "2018-11-03T09:25:19.002736Z", "value": 42}
But if verbosity level escalates, script produces developer friendly colored output
python ./examples/app.py -vv
Metadata
Release files for structlog-boilerplate 0.2
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 |
|---|---|---|---|---|
| structlog-boilerplate-0.2.tar.gz | 3.0 kB | Without provenance | Details for structlog-boilerplate-0.2.tar.gz |
Release files / structlog-boilerplate-0.2.tar.gz
| Download URL | structlog-boilerplate-0.2.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e4da5d277def1460f799e6a8480aa5a44713c8fc0a11016c46eec3cd01def22
|
|
BLAKE2b-256 checksum How to use checksums |
982b36dbd8dfdf497ecdd3b7a63d2282b805b6c4d10de2a8db6f3b85d64fd6b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.12
|
Security for structlog-boilerplate 0.2
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.