+ Added debug decorator
This commit is contained in:
parent
d35110a83b
commit
881ef42f42
15
reginaldCog/debug_stuff.py
Normal file
15
reginaldCog/debug_stuff.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
def debug(func):
|
||||||
|
def wrap(*args, **kwargs):
|
||||||
|
# Log the function name and arguments
|
||||||
|
print(f"DEBUG: Calling {func.__name__} with args: {args}, kwargs: {kwargs}")
|
||||||
|
|
||||||
|
# Call the original function
|
||||||
|
result = func(*args, **kwargs)
|
||||||
|
|
||||||
|
# Log the return value
|
||||||
|
print(f"DEBUG: {func.__name__} returned: {result}")
|
||||||
|
|
||||||
|
# Return the result
|
||||||
|
return result
|
||||||
|
|
||||||
|
return wrap
|
||||||
Loading…
x
Reference in New Issue
Block a user