Projects · What I'm known for
LogEye
Runtime introspection logger for Python. Decorate a function and watch every assignment, mutation, call and return as it happens, no debugger needed.

$ python playground.py
[0.000s] playground.py:3 (set) x = 10
[0.024s] playground.py:4 (set) message = 'Hello from Matt'
[0.026s] playground.py:13 (call) add args=(2, 2)
[0.026s] playground.py:10 (return) add args=(2, 2) -> 4
[0.027s] playground.py:18 (set) config = {'debug': True, 'port': 8080}
[0.027s] playground.py:19 (change) config.port = 9090
[0.027s] playground.py:20 (change) config.debug = False
LogEye is print debugging, automated. Drop @log on a function (or wrap a value in log()) and it reports variable assignments, attribute writes, container mutations, arguments and return values as the code runs, with file and line for each event.
from logeye import log
@log
def add(a, b):
return a + b
add(2, 3)How it works#
- Tracing is built on
sys.settrace, scoped to the decorated code so the rest of the program runs untouched. - Variable names are inferred from the call site by walking the AST, including assignments that span multiple lines.
- Wrapped objects, lists, dicts and sets report their own mutations, recursively for nested structures.
- Output is filterable by level and variable, and can go to stdout or a file.
Educational mode#
With mode="edu", the trace is rewritten into plain sentences ("Calling add(2, 3)", "add(2, 3) returned 5"). It turns an algorithm run into something a student can read top to bottom, which is who I originally built it for: people learning algorithms and the teachers explaining them.
About 4,700 lines across 12 modules, with 16 test modules and 16 runnable demos.
