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
Release history Release notifications | RSS feed
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.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for kode_logger-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f77c00e8f880ac829879019acef39c87c17001e7f7bbc8da673b450902c9860 |
|
MD5 | 83b6d7d56ed82b8ef602e30d9d539bf8 |
|
BLAKE2b-256 | 24d7a29680772e354fc6fb016e1f7bfdf4ed98574be8e3cad62e85a0ba9ee21d |