Skip to main content

Encode logs to JSON format

Project description

KODE Logger

Usage example

import kode_logger


logger = kode_logger.create_json('my-context', tags=['tag1', 'tag2'], extra={'common_variable': 'value'})
logger.warning('hello', extra={
    'my_variable': 'value'
})

Example of produced log message

{
  "@timestamp": "2019-10-22T11:11:42.133Z",
  "message": "hello",
  "level": "WARNING",
  "pid": 40110,
  "context": "my-context",
  "tags": ["tag1", "tag2"],
  "extra": {
    "func_name": "example",
    "line": 5,
    "path": "file.py",
    "process_name": "MainProcess",
    "thread_name": "MainThread",
    "common_variable": "value",
    "my_variable": "value"
  }
}

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

kode_logger-1.0.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kode_logger-1.0.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file kode_logger-1.0.4.tar.gz.

File metadata

  • Download URL: kode_logger-1.0.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for kode_logger-1.0.4.tar.gz
Algorithm Hash digest
SHA256 b8100425d8ef9ac9f274011b8590b572b5a57b7a6a2ed31fbe0042a98dea5fc4
MD5 9d458e05bdc2c3bf7f5cb5407d09a7da
BLAKE2b-256 2bab966847a7d6a58f0765fe2c008a09865d3e1591a80cdb3e9e6f478ab62ccf

See more details on using hashes here.

File details

Details for the file kode_logger-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: kode_logger-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for kode_logger-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 226a052e605ec21c2bbcf92e70e5dc9272370f456bec5ad566779454b0e836ef
MD5 fcd17f66c5d32af7c64b9025436ba9ee
BLAKE2b-256 5e3988b81ee061896caba11cfc1e053e2954c3ad64303a7ce588b6d461cb900d

See more details on using hashes here.

Supported by

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