A lightweight debugging toolkit with function call tracing and logging decorators
Project description
ezDebugger
A lightweight Python debugging toolkit providing decorator-based function call tracing and logging.
Features
- Function Tracing: Automatic logging of function calls with parameters
- Flexible Debugging: Turn debugging on/off dynamically
- Debug Levels: Control verbosity with different debug levels
- Minimal Overhead: Lightweight decorator implementation with no external dependencies
- Class-aware: Distinguishes between class methods and module functions
Installation
Install from PyPI:
pip install ezDebugger
Quick Start
from ezDebugger import Logger
@Logger
def my_function(x, y):
return x + y
# Enable debugging
my_function.active = True
result = my_function(5, 3)
# Output:
# DEBUG: Function Running: my_function()
# | LOCALE -> your_file.py
# | PARAMS -> (5, 3)
# ‾
Usage
Basic Decorator
Use the @Logger decorator on any function:
from ezDebugger import Logger
@Logger
def calculate(a, b):
return a * b
Controlling Debug Output
# Enable/disable debugging
calculate.active = True
calculate.active = False
# Set debug level (controls which functions are shown)
calculate.lvl = 1 # Show all functions
calculate.lvl = 2 # Hide private functions (starting with _)
With Classes
The logger automatically detects class methods and includes class information:
class Calculator:
@Logger
def add(self, x, y):
return x + y
calc = Calculator()
calc.add(5, 3)
# DEBUG: Function Running: Calculator.add()
# | LOCALE -> your_file.py
# | PARAMS -> (5, 3)
# ‾
API Reference
Logger
A decorator class for tracing function execution.
Attributes:
active(bool): Enable/disable debug output (default:True)lvl(int): Debug verbosity level (default:1)- Level 1: Show all functions
- Level 2+: Hide private functions (starting with
_)
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 ezdebugger-0.1.0.tar.gz.
File metadata
- Download URL: ezdebugger-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a814a2ffa7d794b763354226772af244c4ac0d5bd81ab2ee5b7b795b30357b4
|
|
| MD5 |
1f5d8eae91da6a9ba1469c96b0b90ca7
|
|
| BLAKE2b-256 |
cefc9dc02459ba19fba93e63e96c1db9f005ed2194068ff646a0f0bed64e6cad
|
File details
Details for the file ezdebugger-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ezdebugger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f76f909488c3e20fffe271657e0b8263cd0fed29251e5fef4453f145e502fa12
|
|
| MD5 |
d2ecad641369b8afca932417e0fbee09
|
|
| BLAKE2b-256 |
8002474094ef10b99a6e864e20ff822fd2bb5ab97b36f68f22a0329e476c6e2e
|