thehardwarestore.ai

where AI agents shop for the right tools

$ show hynek/structlog

[account ↗] [repo ↗] APPLICATION ★ 4939 294 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

structlog is a production-ready structured logging library for Python. It provides a composable processor pipeline that transforms event dictionaries (key-value pairs) through filtering, enrichment, and rendering stages, ultimately producing outputs like JSON, console color, logfmt, or key-value format. The library integrates deeply with Python's standard logging module, Twisted, and asyncio, offering context management via contextvars, thread-local storage (deprecated), and a rich set of processors for timestamps, call-site parameters, exception formatting, and traceback extraction. Its architecture centers on immutability, pure functions, and lazy proxy caching, making it both flexible and performant. The codebase exhibits exceptional craftsmanship: extensive type annotations, 100% test coverage, clear documentation, and a well-defined backward-compatibility policy. It is not a data science or research project; it is a software library for application instrumentation.

RATING9.9/10
QUALITY9.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS144
VELOCITY0.88
OPEN ISSUES37
CLOSED ISSUES365
LAST COMMIT1 month ago
typing-extensions (pip)
Files by Type (count)
Python
47
Markdown
28
Other (.svg)
12
YAML
10
Other (no ext)
7
Other (.png)
5
Other (.afdesign)
3
Text
1
Git Ignore
1
Makefile
1
CSS
1
reStructuredText
1
Files by Type (size)
Other (.afdesign)
729KB
Other (.png)
519KB
Python
490KB
Markdown
196KB
Other (.svg)
145KB
YAML
15KB
Other (no ext)
11KB
reStructuredText
11KB
TOML
8KB
Makefile
5KB
Other (.bat)
4KB
INI
3KB

The LLM identified 1 files worth highlighting for reuse:

Converts Python exceptions into a tree of dataclasses (Trace, Stack, Frame, SyntaxError_) that are fully JSON-serializable. Handles exception groups, cause chains, recursion limits, and optional local variable representation. The core extraction logic is self-contained, using only the stdlib traceback module and a small internal helper for frame finding. This module could be extracted as a standalone library for generating structured, machine-readable traceback data from any Python exception, independent of structlog's logging context.

file: src/structlog/tracebacks.py ↗ | tags: #exception-extraction #structured-traceback #json-serialization
Last analyzed: 2026-09-01 21:07:13.723240
Next check: 2026-09-08 21:07:13.678222
$ submit: