Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Let's write beautiful logs

Project description

Coveralls Travis CI Latest Version

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


Release history Release notifications

This version
History Node

0.2.0

History Node

0.1.1

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
prettylog-0.2.0-py3-none-any.whl (3.6 kB) Copy SHA256 hash SHA256 Wheel py3 May 10, 2018
prettylog-0.2.0.tar.gz (3.6 kB) Copy SHA256 hash SHA256 Source None May 10, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page