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-0.0.6.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for kode_logger-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e52519fbd8735e0cd2a73fdd27bc4f0d25ba86097e3022a989e4f2a00ca3655e |
|
MD5 | 2b625357e15a455428ac170b9ce64cb4 |
|
BLAKE2b-256 | e83c8c6bd6f399c0f22a3cf94c1d6da2724ac19e6d92619f246567acd2593332 |