Let's write beautiful logs
Project description
Let’s write beautiful logs:
import logging
from prettylog import basic_config
# Configure logging
basic_config(level=logging.INFO, buffered=False, log_format='color')
Available formats
stream - default behaviour
color - colored logs
json - json representation
syslog - writes to syslog
Quick start
Setting up json logs:
import logging
from prettylog import basic_config
# Configure logging
basic_config(level=logging.INFO, buffered=False, log_format='json')
Buffered log handler
Parameter buffered=True enables memory buffer which flushing logs delayed.
import logging
from prettylog import basic_config
basic_config(
level=logging.INFO,
buffered=True,
buffer_size=10, # flush each 10 log records
flush_level=loggging.ERROR, # or when record with this level will be sent
log_format='color',
)
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
prettylog-0.1.1.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file prettylog-0.1.1.tar.gz
.
File metadata
- Download URL: prettylog-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9532040b2227a98bbe1b8409937f28359dcc09e58ccee57d03cc6850fe06faf4 |
|
MD5 | fdd7813bc1756e31add91bf4a6411866 |
|
BLAKE2b-256 | 8c0574bc2beb2ae23b27df6b348ed599c276bd22fad28f4206c049b111c2fefa |
File details
Details for the file prettylog-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: prettylog-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25898922065fcaf36399f51a816678eb1be9ff094fcac3fc8ebff9e2ec7b3a6d |
|
MD5 | 405bc65097d328001a75883adc025bc3 |
|
BLAKE2b-256 | 1827dd6f3f1135945ac60f22fc7eeb86a924911da1510fa70a07448cf1896c8d |