--- id: structlog-pretty version: "0.4.3" license: unclear license_treatment: permissive maintenance: dormant --- # structlog-pretty — A collection of structlog processors for prettier output License: permissive · Maintenance: dormant · Downloads: 109.3K/mo ## 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 above — 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 pip install structlog-pretty uv add structlog-pretty 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 109.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags structlog formatting processors, pretty print structured logs, JSON log prettifier, syntax highlight log output, structured logging enhancement, logging, structlog, formatting [View on SkillFed](https://skillfed.io/packages/structlog-pretty) · [View on PyPI](https://pypi.org/project/structlog-pretty/)