Opinionated JSON logger
Project description
Trustpilot Logging
Opinionated json logging module used by Trustpilot, ( based on python-json-logger by madzak )
Installation
Install the package from PyPI using pip:
pip install trustpilot-logging
Usage
import trustpilot_json_logging
logging = trustpilot_json_logging.setup_logging()
logging.warning("i'm alive")
# outputs
# {"message": "i'm alive", "Module": "root", "Severity": "INFO"}
Advanced Usage
import trustpilot_json_logging
logging = trustpilot_json_logging.setup_logging("INFO", sys.stderr, ignore={"elasticsearch":"WARNING"})
logging.info({
"message": "i just arrived",
"age": 32,
"location": "north pole"
})
# outputs
# {"message": "i just arrived", "age": 32, "location": "north pole", "Module": "root", "Severity": "INFO"}
Publish new version
To publish a new version:
- Make pr with
- your changes
- good linting:
black .
should be happy - bump semantic version
- get pr reviewed
- merge to master
- pull master locally and run
poetry publish
with the TP pypi credentials
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
Built Distribution
File details
Details for the file trustpilot-json-logging-1.0.12.tar.gz
.
File metadata
- Download URL: trustpilot-json-logging-1.0.12.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.1 Darwin/19.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a7be356fbb6d51df380d230a3abf83c9ad260b492347466508001096e33f5b6 |
|
MD5 | 2650f2322deb80314d26bb4b36633502 |
|
BLAKE2b-256 | f99d94a4d4efb9de8464f638898414108428d5edc9b44c25e7feb6ed06cc184c |
File details
Details for the file trustpilot_json_logging-1.0.12-py3-none-any.whl
.
File metadata
- Download URL: trustpilot_json_logging-1.0.12-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.8.1 Darwin/19.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6701182e7361d62c0e243e829e3676c8e131916f6c055736564104ab78daecfa |
|
MD5 | 607ae0dc61920923b7059fc5bac0ec3b |
|
BLAKE2b-256 | 077b4fbd207f438024292e2be14767d48b9161f77ff99aa8dba42b06f54c64f5 |