A Python package for easy and convenient debugging
Project description
Wraps a function to log its execution, including all args, kwargs, execution result, and errors.
Wrapper does not make any changes that affect the result of code execution or errors.
SUPPORTS: default 'logging.Logger' and 'loguru.logger'
Usage:
import logging
from pretty_debugger import pretty_wrapper
logger = logging.getLogger(__name__)
@pretty_wrapper(logger)
def foo(bar):
return f"Hello, {bar}"
foo("world")
Corresponding output:
┯
├─► foo( --- [NONREPO/test.py:6]
│ bar='world',
│ )
┊ └► 'Hello, world' [0.0000s]
┷
Output when using nested wrapped functions:
┯
├─► main_task() --- [NONREPO/test.py:12]
┊ ├─► get_data( --- [NONREPO/test.py:24]
┊ │ arg=42,
┊ │ kwarg='active',
┊ │ )
┊ ┊ └► 420 [0.0000s]
┊ ├─► check_status() --- [NONREPO/test.py:29]
┊ ┊ └► None [0.0000s]
┊ ├─► generate_error() --- [NONREPO/test.py:34]
┊ ┊ └X <RuntimeError('Critical Failure')> [0.0000s]
┊ └X <RuntimeError('Critical Failure')> [0.0003s]
┷
Param logger: Logger (of default 'logging' or 'loguru' module)
with encoding 'utf-8'.
Param debug_level: Custom debug level. If not specified, the
logger debug level or WARNING level is used, whichever is higher.
Param round_exec_time: Round the execution time to N after the decimal point
Returns: Wrapped function
Zero-dependency: Package does not require installation of additional libraries. Only default packages are included: inspect, logging, os, and time.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretty_debugger-0.3.1.tar.gz.
File metadata
- Download URL: pretty_debugger-0.3.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b13e143913ed7dddd87979cfcf791dc61ab2a29ea539ed8b96243b68d5e23535
|
|
| MD5 |
e5fe018ffeab32fd97e47c9696e58dcd
|
|
| BLAKE2b-256 |
0ccc71004d1bcb4cefb7d50c33509123ab4ebb70b0185bcf5144f1ca48cee478
|
Provenance
The following attestation bundles were made for pretty_debugger-0.3.1.tar.gz:
Publisher:
publish.yml on PyCrow/pretty_debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretty_debugger-0.3.1.tar.gz -
Subject digest:
b13e143913ed7dddd87979cfcf791dc61ab2a29ea539ed8b96243b68d5e23535 - Sigstore transparency entry: 1109427219
- Sigstore integration time:
-
Permalink:
PyCrow/pretty_debugger@e9bed37b38f79c865b10d48af4757a393ecb1acd -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/PyCrow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9bed37b38f79c865b10d48af4757a393ecb1acd -
Trigger Event:
release
-
Statement type:
File details
Details for the file pretty_debugger-0.3.1-py3-none-any.whl.
File metadata
- Download URL: pretty_debugger-0.3.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7207040abd8ef1db14ebe07b7dfec2bfd65e884ddd41bed0deacf9c79fa81822
|
|
| MD5 |
8ddf0233464e842fe6949fff08ba0b84
|
|
| BLAKE2b-256 |
95d6bdc806aeb9885cebe01b51b6a4d90a5af95109c9542b4ff4c5c798890a82
|
Provenance
The following attestation bundles were made for pretty_debugger-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on PyCrow/pretty_debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretty_debugger-0.3.1-py3-none-any.whl -
Subject digest:
7207040abd8ef1db14ebe07b7dfec2bfd65e884ddd41bed0deacf9c79fa81822 - Sigstore transparency entry: 1109427227
- Sigstore integration time:
-
Permalink:
PyCrow/pretty_debugger@e9bed37b38f79c865b10d48af4757a393ecb1acd -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/PyCrow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e9bed37b38f79c865b10d48af4757a393ecb1acd -
Trigger Event:
release
-
Statement type: