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.

Source Distribution

trustpilot-json-logging-1.0.12.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

trustpilot_json_logging-1.0.12-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for trustpilot-json-logging-1.0.12.tar.gz
Algorithm Hash digest
SHA256 3a7be356fbb6d51df380d230a3abf83c9ad260b492347466508001096e33f5b6
MD5 2650f2322deb80314d26bb4b36633502
BLAKE2b-256 f99d94a4d4efb9de8464f638898414108428d5edc9b44c25e7feb6ed06cc184c

See more details on using hashes here.

File details

Details for the file trustpilot_json_logging-1.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for trustpilot_json_logging-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6701182e7361d62c0e243e829e3676c8e131916f6c055736564104ab78daecfa
MD5 607ae0dc61920923b7059fc5bac0ec3b
BLAKE2b-256 077b4fbd207f438024292e2be14767d48b9161f77ff99aa8dba42b06f54c64f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page