Skip to main content

logpretty

Beautiful, colorful logging for Python — zero config


Before / After

Before (default Python logging):

INFO:root:Server started
WARNING:app.auth:Invalid token
ERROR:app.db:Connection failed

After (with logpretty):

14:32:05  INFO      app.main                   Server started
14:32:06  WARNING   app.auth                   Invalid token
14:32:07  ERROR     app.db                     Connection failed

With colors: INFO is green, WARNING is yellow, ERROR is red.

Install

pip install logpretty

Usage

from logpretty import setup_logging, get_logger

setup_logging()  # one line, done

logger = get_logger(__name__)
logger.info("Server started")
logger.warning("Slow query detected")
logger.error("Connection failed")

Features

  • Colored output (auto-disabled in CI / pipes)
  • Aligned columns for easy scanning
  • Timestamps in HH:MM:SS format
  • Long logger names auto-truncated
  • Exception tracebacks included
  • Zero dependencies — pure Python
  • Drop-in replacement for logging.basicConfig()

Configuration

setup_logging(
    level="DEBUG",       # log level
    colors=True,         # force colors on/off (auto by default)
    show_time=True,      # show/hide timestamp
    show_name=True,      # show/hide logger name
)

License

MIT

Release files for logpretty 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logpretty 0.1.0
File Size Uploaded
logpretty-0.1.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for logpretty 0.1.0
File Interpreter ABI Platform
logpretty-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / logpretty-0.1.0.tar.gz

Download URL logpretty-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d8c87958643b9c2a89ba4b3e40fb816a6c9bbec04c60ac6a7f32d64381b4610d
BLAKE2b-256 checksum
How to use checksums
d4f892ba410a167c2f4c5567ac3e41a750afd82f046fc8617dd80f3ede19f866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / logpretty-0.1.0-py3-none-any.whl

Download URL logpretty-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd2e6885aa25f339183fc577636e375ae9f4c89bc3994fe6f05f0fba809a08c4
BLAKE2b-256 checksum
How to use checksums
fa8813e8afcf71fe64a2091b1dc0dd8a909ffe6cf140ed2bbaff8e5b6f757c97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page