Skip to main content

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(
│    bar=world,
│  )
┊  └► Hello, world  (0.0000s)
┷

Output when using nested wrapped functions:

┯
├─►foobar(
│    some_arg=0,
│  )
┊  ├─►plus_one(
┊  │    some_arg=0,
┊  │  )
┊  ┊  └► 1  (1.0011s)
┊  ├─►exception_func(
┊  │    this_is_kwarg=True,
┊  │  )
┊  ┊  └X <Exception('SOME TEST EXCEPTION')>  (0.0000s)
┊  └X <Exception('SOME TEST EXCEPTION')>  (1.0022s)
┷

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretty_debugger-0.2.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretty_debugger-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pretty_debugger-0.2.1.tar.gz.

File metadata

  • Download URL: pretty_debugger-0.2.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pretty_debugger-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b0b1cbcbd65ad97ebd125332ecead090d33a2ec064dfd8536f47bd2c4d1b8fb5
MD5 52f93f39dc9b11984c960525e8c22e7f
BLAKE2b-256 54a23d21fbf3545cdceb646cf93656b0ce3a3a3037426308cf4933422f8a46ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretty_debugger-0.2.1.tar.gz:

Publisher: publish.yml on PyCrow/pretty_debugger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pretty_debugger-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pretty_debugger-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3054ecaa7ecece08275df8176dc0e6d9e3acd17d2e1980db4bbd08de507aec84
MD5 286e90ea440bead65efd82fe7dc25d2e
BLAKE2b-256 e234c86c3d882eefca3d9e112ad8f3d4c7d7c97e7b0d1525b4e2406cd3105b40

See more details on using hashes here.

Provenance

The following attestation bundles were made for pretty_debugger-0.2.1-py3-none-any.whl:

Publisher: publish.yml on PyCrow/pretty_debugger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page