logdecorator
Move logging code out of your business logic with decorators
Decision gist · record as of 2026-08-14
Yes, if you want a lightweight, zero-dependency way to add structured logging to functions without embedding log statements in business logic. The dormant maintenance status (last release 545 days ago) is a minor concern for a stable utility library, but verify that async decorator support and format-string behavior match your logging patterns before committing to it in a new project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction installation with no runtime dependencies.
- Maintenance is dormant—last release was 545 days ago, though the repository remains active with a recent commit on 2025-02-15 and modest community interest (82 stars).
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) means you can use, modify, and distribute logdecorator freely in commercial and private projects with minimal restrictions.
last release 2025-02-15 (545 days) · last repo commit 2025-02-15 · 82 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 103,146 downloads/mo, #12,827 on PyPI
Alternatives
Verify before relying
pip install logdecorator
import logging
from logdecorator import log_on_start, log_on_end, log_on_error
@log_on_start(logging.DEBUG, "Starting {url}")
@log_on_end(logging.DEBUG, "Finished {url}")
@log_on_error(logging.ERROR, "Error: {e!r}")
def download(url):
pass
logging.basicConfig(level=logging.DEBUG)
download("https://example.com")- Whether async decorator support (async_log_on_start, etc.) is fully documented and stable.
- Performance impact of decorator overhead on frequently-called functions.
- Compatibility with popular logging frameworks beyond the standard library.
What it is and what it does
Logdecorator is a lightweight decorator library that attaches logging to Python functions without embedding log statements in business logic. It provides four main decorators—log_on_start, log_on_end, log_on_error, and log_exception—that trigger at corresponding points in function execution, plus async variants for coroutines. Messages support Python format strings with access to function arguments, return values, and exception objects, keeping code readable while maintaining comprehensive logging coverage.
The library targets developers who want logging instrumentation without the visual noise of try-except blocks or logger calls scattered through their code. With zero runtime dependencies and a simple decorator-based API, it integrates into existing Python projects with minimal friction. It requires Python 3.10 or later and is maintained under a permissive MIT license.
Use it for
- Wrap API endpoint handlers to log incoming requests and outgoing responses without polluting handler code.
- Decorate data processing functions to track execution flow and timing across a data pipeline.
- Add error logging to utility functions that should fail loudly but keep their implementation clean.
- Instrument async tasks to log lifecycle events (start, completion, failure) in concurrent applications.
- Create audit trails for sensitive operations by logging arguments and results at function boundaries.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you want a lightweight, zero-dependency way to add structured logging to functions without embedding log statements in business logic.
The dormant maintenance status (last release 545 days ago) is a minor concern for a stable utility library, but verify that async decorator support and format-string behavior match your logging patterns before committing to it in a new project.
Install
logdecorator on PyPI
Before you install
Low friction installation with no runtime dependencies. Maintenance is dormant—last release was 545 days ago, though the repository remains active with a recent commit on 2025-02-15 and modest community interest (82 stars).
Requires Python 3.10 or later.
License in practice
MIT license (permissive) means you can use, modify, and distribute logdecorator freely in commercial and private projects with minimal restrictions.
Quickstart
pip install logdecorator
import logging
from logdecorator import log_on_start, log_on_end, log_on_error
@log_on_start(logging.DEBUG, "Starting {url}")
@log_on_end(logging.DEBUG, "Finished {url}")
@log_on_error(logging.ERROR, "Error: {e!r}")
def download(url):
pass
logging.basicConfig(level=logging.DEBUG)
download("https://example.com")
Verify before relying
- Whether async decorator support (async_log_on_start, etc.) is fully documented and stable.
- Performance impact of decorator overhead on frequently-called functions.
- Compatibility with popular logging frameworks beyond the standard library.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 545 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,146 / month, #12,827 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: System :: Logging |
Evidence: logdecorator-2.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python function logging decorators”
- logdecoratorLogdecorator provides Python decorators to add logging to functions…
- essentialsEssentials provides reusable core classes and utility functions for…
- decoratorProvides utilities for writing function decorators that preserve the…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also Autologging · undecorated · entrypoint · logfury · python-simple-logger · parameter-decorators · botoinator · python-backoff · redo · wrapt