9month-revision-reginald #19

Merged
AllfatherHatt merged 3 commits from 9month-revision-reginald into master 2026-03-16 12:21:22 +01:00
Showing only changes of commit 8f0ece3570 - Show all commits

View File

@ -1,15 +1,24 @@
import functools
import inspect
def debug(func):
if inspect.iscoroutinefunction(func):
@functools.wraps(func)
async def wrap(*args, **kwargs):
print(f"DEBUG: Calling {func.__name__} with args: {args}, kwargs: {kwargs}")
result = await func(*args, **kwargs)
print(f"DEBUG: {func.__name__} returned: {result}")
return result
return wrap
@functools.wraps(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