From 881ef42f426ede41b6a5af57978454ae547be47a Mon Sep 17 00:00:00 2001 From: T-BENZIN Date: Tue, 18 Mar 2025 19:50:12 +0500 Subject: [PATCH] + Added debug decorator --- reginaldCog/debug_stuff.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 reginaldCog/debug_stuff.py diff --git a/reginaldCog/debug_stuff.py b/reginaldCog/debug_stuff.py new file mode 100644 index 0000000..92ccdf0 --- /dev/null +++ b/reginaldCog/debug_stuff.py @@ -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