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.3.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for kode_logger-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51d380f66ee225f411c22b06b9e60ca10658691a11ae62433221b746a67219b7 |
|
MD5 | 499477894ef0fbefd2ac633e77d6cec7 |
|
BLAKE2b-256 | f37fac9f2e5b20732d237e080965ac675ad7694f7c6fa04c2b6b59382b1601d3 |