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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a66ac77e78f21611fcd7ee3c470986c5a26316cc582786303a69741cfca0696 |
|
MD5 | b6a277b9cf2635e58f83e8b567283403 |
|
BLAKE2b-256 | 9d5064b1068d2eaab2d3de0c47ecee6bced623799c22ec9cfbd7b28429e242fc |
Close
Hashes for trustpilot_json_logging-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4965e82b1d09b0b9ba5b89aa7f5bfd4a74c97cff9472cf1b29ff5e2daad04f2e |
|
MD5 | 18cb5ac08fadaa47659e22f785226b74 |
|
BLAKE2b-256 | 85950cc5bfadc21262317092ea4798d89a41a13bad308c6d05b0cbbd0ee8d676 |