Registry / observability / logdecorator

logdecorator

JSON →
library2.5pypypiunverified

Move logging code out of your business logic with decorators. Lightweight library (v2.5) that provides @log_decorator and related decorators for automatic logging of function calls, arguments, results, and exceptions. Requires Python >=3.10. Stable release cadence (sporadic).

pip install logdecorator
INSTALL
IMPORT
SIG · LOGDECORATOR
L
logdecorator
observabilitypythonv2.5
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

log_decorator
from logdecorator import log_decorator
from logdecorator import log_decorator

Basic usage: decorate a function to log its calls with INFO level.

from logdecorator import log_decorator, log_level import logging logging.basicConfig(level=logging.INFO) @log_decorator(log_level.INFO) def my_function(a, b): return a + b my_function(1, 2)
Debug
Known issues
breakingIn version 2.x, the import path changed. `from logdecorator import log_decorator` is correct; `from logdecorator.LogDecorator import log_decorator` no longer works.
fix
Use `from logdecorator import log_decorator`.
affects: >=2.0
deprecatedThe `log_exception` decorator has been replaced by using `@log_decorator(log_level.ERROR, exception_only=True)`.
fix
Use `@log_decorator(log_level.ERROR, exception_only=True)` instead of `@log_exception`.
affects: >=2.0
gotchaThe `log_level` argument must be the constant from `logdecorator.log_level`, not a string like 'INFO'.
fix
Use `log_level.INFO` instead of `'INFO'`.
affects: all
Upgrade
Version history
2.5latest on PyPI · released Feb 15, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
12
Amazon
2
OpenAI (training)
2
Resources
logdecorator — pip install logdecorator · libregistry