Skip to main content

Let's write beautiful logs

Project description

Coveralls Travis CI Latest Version https://img.shields.io/pypi/wheel/prettylog.svg https://img.shields.io/pypi/pyversions/prettylog.svg https://img.shields.io/pypi/l/prettylog.svg

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)

Uploaded Source

Built Distribution

prettylog-0.3.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

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

Hashes for prettylog-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e417a7988ef26b457ef9021e0e6417d01d0c49b41732a0fe255b5bed109396f0
MD5 64f4c751eba46924156c84fff99c3fda
BLAKE2b-256 5f41b651d83744047f063d2afbc9a13e6e7e9892874c15d5cdc6c9b8f5832164

See more details on using hashes here.

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

Hashes for prettylog-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0880b5fb0986237e21511e85a6c2a942a0087e65ad0a836b77a5b59ce44cd58
MD5 cb29d2f225be16e94202595d6acb1ba7
BLAKE2b-256 a6ef38159268150bd6872864951d8efb661aa153362dfd150fb74ecbb3fc9db0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page