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 details)
Built Distribution
File details
Details for the file prettylog-0.3.0.tar.gz
.
File metadata
- Download URL: prettylog-0.3.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e417a7988ef26b457ef9021e0e6417d01d0c49b41732a0fe255b5bed109396f0 |
|
MD5 | 64f4c751eba46924156c84fff99c3fda |
|
BLAKE2b-256 | 5f41b651d83744047f063d2afbc9a13e6e7e9892874c15d5cdc6c9b8f5832164 |
File details
Details for the file prettylog-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: prettylog-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0880b5fb0986237e21511e85a6c2a942a0087e65ad0a836b77a5b59ce44cd58 |
|
MD5 | cb29d2f225be16e94202595d6acb1ba7 |
|
BLAKE2b-256 | a6ef38159268150bd6872864951d8efb661aa153362dfd150fb74ecbb3fc9db0 |