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.2.0.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file prettylog-0.2.0.tar.gz
.
File metadata
- Download URL: prettylog-0.2.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89a61d456c2fe9aa75426b7c0937ee25835a96e13b79323791442aa424ed7b3c |
|
MD5 | 71a0eb38de5cd30866dbfb4fdb1cc95b |
|
BLAKE2b-256 | d0ee691d5c4a7563e1f045ea0b0aae9358ddea6395e1e2b89b701d517281045d |
File details
Details for the file prettylog-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: prettylog-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 708eece7f12e336105ec1bf827fe5ae52ddf7754ba16e33e48e97b6cf00f03f6 |
|
MD5 | f32c3db56d5801c92aa46819be917fa5 |
|
BLAKE2b-256 | 1a2c1ec7f25801a3d6cb32dd83fa7ccf1a05706eabc776dd799663f5158c97ec |