skillfed

structlog-pretty

A collection of structlog processors for prettier output

structlog-pretty v0.4.3 109.3K downloads/30d#12,522 on PyPI37
Permissive license DORMANT released

What it is and what it does

structlog-pretty is a collection of processors that integrate with structlog to make structured log output more human-readable. It provides syntax highlighting for code snippets in logs, prettification for JSON and XML fields, multiline string formatting, and numeric rounding for cleaner output. The package wraps around structlog's processor pipeline, so you add its processors to your logging configuration and it transforms specific fields in your log events on the fly.

The package is designed for developers who use structlog and want logs that are easier to read during development or debugging without changing the underlying structured format. It has low install friction—just pygments as a runtime dependency—and comes with optional faster processors if you install the [fast] extra, though those require C compilation and libxml.

Use it for:

  • Format JSON request/response payloads in logs for readability during API debugging.
  • Highlight code snippets embedded in log messages with syntax coloring.
  • Pretty-print XML responses in SOAP or other XML-based service logs.
  • Round numeric timing values to a fixed number of digits for cleaner performance logs.
  • Display multiline strings (stack traces, formatted output) without mangling indentation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds structlog processors that format log output with syntax highlighting, JSON/XML prettification, multiline string handling, and numeric rounding for more readable structured logs.

Yes, if you use structlog and want prettier logs without extra dependencies beyond pygments. The dormant maintenance status is not a blocker—the package is stable and focused—but verify compatibility with your structlog and Python versions before adopting. No known security vulnerabilities.

Install

structlog-pretty on PyPI

pip

pip install structlog-pretty

uv

uv add structlog-pretty

poetry

poetry add structlog-pretty

Installing structlog-pretty

Before you install

Low friction install with a single runtime dependency (pygments). Maintenance is dormant—last commit was 2024-07-15 and no updates in 760 days—but the repository remains active and unarchived, suggesting the package is stable rather than abandoned.

License in practice

Licensed under MIT (permissive), so you can use it freely in commercial and private projects with minimal restrictions.

Quickstart

pip install structlog-pretty

import structlog
import structlog_pretty

structlog.configure(
    processors=[
        structlog_pretty.SyntaxHighlighter({'request': 'json'}),
        structlog_pretty.MultilinePrinter(['request']),
    ]
)

Requires Python 3; optional C extensions for faster processors need libxml installed.

Verify before relying

  • Whether the package works with recent structlog versions and modern Python 3.x releases.
  • Performance characteristics of the optional [fast] extras and whether libxml availability is common in typical deployment environments.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — pygments
Maintenance dormant — 760 days since the last release
Last repo commit
First released
Downloads 109,287/month — #12,522 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: structlog_pretty-0.4.3-py3-none-any.whl

Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: Only

Tags

structlog formatting processorspretty print structured logsJSON log prettifiersyntax highlight log outputstructured logging enhancement
loggingstructlogformatting

More Text Processing packages