oppinionated 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"}
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
Close
Hashes for trustpilot-json-logging-1.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bc9a2f086431f3e46c1a96e6fe50e9282f90354ac74f9430d28ec49448374d2 |
|
MD5 | 871aa903457694b886891a6eabe1d73c |
|
BLAKE2b-256 | 9cc1c559dda3f035018aaf3546b805f799ee3b3c754ba86ea782d9c22b23dfb0 |
Close
Hashes for trustpilot_json_logging-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f747ffb0a1785c7a735450f9649d65980cb84ac48bf652c3c416d6d57e3f8e60 |
|
MD5 | 695190301702157de64ee42312012b24 |
|
BLAKE2b-256 | 4b7ceea3d6b46a02271fc3022663bc329dbb33a90c97c5718ed95fc74ec0c6dc |