Skip to main content

Opinionated JSON logger

Project description

Trustpilot Logging

Build Status Latest Version Python Support

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:

  1. Make pr with
    1. your changes
    2. good linting: black . should be happy
    3. bump semantic version
  2. get pr reviewed
  3. merge to master
  4. 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.

Files for trustpilot-json-logging, version 1.0.12
Filename, size File type Python version Upload date Hashes
Filename, size trustpilot_json_logging-1.0.12-py3-none-any.whl (6.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size trustpilot-json-logging-1.0.12.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page