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',
date_format=None, # Disable date for logs, True enables it.
# str with format is custom date format.
)
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.3.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for prettylog-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0880b5fb0986237e21511e85a6c2a942a0087e65ad0a836b77a5b59ce44cd58 |
|
MD5 | cb29d2f225be16e94202595d6acb1ba7 |
|
BLAKE2b-256 | a6ef38159268150bd6872864951d8efb661aa153362dfd150fb74ecbb3fc9db0 |