Projects · What I'm known for

LogEye

Stable 2026 – now Author and maintainer

Runtime introspection logger for Python. Decorate a function and watch every assignment, mutation, call and return as it happens, no debugger needed.

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, sets and deques report their own mutations, recursively for nested structures, and heapq calls show up as the call that made them (heappush(queue, (1, 'B'))).
  • It only watches: a list sorted in place is still sorted for the caller, and objects keep their class and methods.
  • Generators, async functions and async generators are traced too, across every yield and await.
  • 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 5,600 lines across 12 modules and no dependencies, with 21 test modules and 10 runnable demos, tested in CI on Python 3.8 to 3.14 on Linux, macOS and Windows.