DEV Community

ItsEvilDuck
ItsEvilDuck

Posted on Originally published at itsevilduck.gumroad.com

Recursion Call Logger: Visualize Recursive Function Calls

Today, QuackBuilds is releasing Recursion Call Logger, a new decorator designed to help developers understand recursive function execution.

This tool provides a lightweight way to log the entry into and exit from recursive functions. When applied to a recursive function, it prints messages to the console, showing when the function is called and when it returns. The key feature is its use of indentation: each nested recursive call increases the indentation level of the log output. This visual representation allows for a clearer understanding of the call stack's depth and flow.

Recursion Call Logger is built for developers who are working with complex recursive algorithms and need a straightforward method to trace their execution. It can be useful for debugging logic errors or simply for gaining a better intuition about how a specific recursive function unfolds during runtime. It does not alter the function's behavior beyond adding log output.

Recursion Call Logger

Top comments (0)