Hi guys!
I've attended Warsaw IT Days 2026 and the lecture "Logging module adventures" was really interesting.
I thought that having filters and such was good long term, but for short algorithms, or for beginners, it's not something that would be convenient for every single file.
So I made LogEye!
Here is the repo: https://github.com/MattFor/LogEye
I've also learned how to publish on PyPi: https://pypi.org/project/logeye/
There are also a lot of tests and demos I've prepared, they're on the git repo
I'd be really really grateful if you guys could check it out and give me some feedback
What My Project Does
Automatically logs variable assignments with inferred names
Infers variable names at runtime (even tuple assignments)
Tracks nested data structures dicts, lists, sets, objects
Logs mutations in real time append, pop, setitem, add, etc.
Traces function calls, arguments, local variables, and return values
Handles recursion and repeated calls func, func_2, func_3 etc.
Supports inline logging with a pipe operator "value" | l
Wraps callables (including lambdas) for automatic tracing
Logs formatted messages using both str.format and $template syntax
Allows custom output formatting
Can be enabled/disabled globally very quickly
Supports multiple path display modes (absolute / project / file)
No setup just import and use
Target Audience
LogEye is mainly for:
beginners learning how code executes
people debugging algorithms or small scripts
quick prototyping where setting up logging/debuggers are a bit overkill
It is not intended for production logging systems or performance-critical code, it would slow it down way too much.
Comparison
Compared to Python's existing logging module:
logging requires setup (handlers, formatters, config)
LogEye works immediately, just import it and you can use it
Compared to using print():
print() requires manual placement everywhere
LogEye automatically tracks values, function calls, and mutations
Compared to debuggers:
Usage
Simply install it with
pip install logeye
and then import is like this:
from logeye import log
Here's an example:
from logeye import log
x = log(10)
@log
def add(a, b):
total = a + b
return total
add(2, 3)
Output:
[0.002s] print.py:3 (set) x = 10
[0.002s] print.py:10 (call) add = {'args': (2, 3), 'kwargs': {}}
[0.002s] print.py:7 (set) add.a = 2
[0.002s] print.py:7 (set) add.b = 3
[0.002s] print.py:8 (set) add.total = 5
[0.002s] print.py:8 (return) add = 5
Here's a more advanced example with Dijkstras algorithm
from logeye import log
@log
def dijkstra(graph, start):
distances = {node: float("inf") for node in graph}
distances[start] = 0
visited = set()
queue = [(0, start)]
while queue:
current_dist, node = queue.pop(0)
if node in visited:
continue
visited.add(node)
for neighbor, weight in graph[node].items():
new_dist = current_dist + weight
if new_dist < distances[neighbor]:
distances[neighbor] = new_dist
queue.append((new_dist, neighbor))
queue.sort()
return distances
graph = {
"A": {"B": 1, "C": 4},
"B": {"C": 2, "D": 5},
"C": {"D": 1},
"D": {}
}
dijkstra(graph, "A")
And the output:
[0.002s] dijkstra.py:39 (call) dijkstra = {'args': ({'A': {'B': 1, 'C': 4}, 'B': {'C': 2, 'D': 5}, 'C': {'D': 1}, 'D': {}}, 'A'), 'kwargs': {}}
[0.002s] dijkstra.py:5 (set) dijkstra.graph = {'A': {'B': 1, 'C': 4}, 'B': {'C': 2, 'D': 5}, 'C': {'D': 1}, 'D': {}}
[0.002s] dijkstra.py:5 (set) dijkstra.start = 'A'
[0.002s] dijkstra.py:5 (set) dijkstra.node = 'A'
[0.002s] dijkstra.py:5 (set) dijkstra.node = 'B'
[0.002s] dijkstra.py:5 (set) dijkstra.node = 'C'
[0.002s] dijkstra.py:5 (set) dijkstra.node = 'D'
[0.002s] dijkstra.py:6 (set) dijkstra.distances = {'A': inf, 'B': inf, 'C': inf, 'D': inf}
[0.002s] dijkstra.py:6 (change) dijkstra.distances.A = {'op': 'setitem', 'value': 0, 'state': {'A': 0, 'B': inf, 'C': inf, 'D': inf}}
[0.002s] dijkstra.py:9 (set) dijkstra.visited = set()
[0.002s] dijkstra.py:11 (set) dijkstra.queue = [(0, 'A')]
[0.002s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (0, 'A'), 'state': []}
[0.002s] dijkstra.py:15 (set) dijkstra.node = 'A'
[0.002s] dijkstra.py:15 (set) dijkstra.current_dist = 0
[0.002s] dijkstra.py:18 (change) dijkstra.visited = {'op': 'add', 'value': 'A', 'state': {'A'}}
[0.002s] dijkstra.py:21 (set) dijkstra.neighbor = 'B'
[0.002s] dijkstra.py:21 (set) dijkstra.weight = 1
[0.002s] dijkstra.py:23 (set) dijkstra.new_dist = 1
[0.002s] dijkstra.py:24 (change) dijkstra.distances.B = {'op': 'setitem', 'value': 1, 'state': {'A': 0, 'B': 1, 'C': inf, 'D': inf}}
[0.002s] dijkstra.py:25 (change) dijkstra.queue = {'op': 'append', 'value': (1, 'B'), 'state': [(1, 'B')]}
[0.002s] dijkstra.py:21 (set) dijkstra.neighbor = 'C'
[0.002s] dijkstra.py:21 (set) dijkstra.weight = 4
[0.002s] dijkstra.py:23 (set) dijkstra.new_dist = 4
[0.002s] dijkstra.py:24 (change) dijkstra.distances.C = {'op': 'setitem', 'value': 4, 'state': {'A': 0, 'B': 1, 'C': 4, 'D': inf}}
[0.002s] dijkstra.py:25 (change) dijkstra.queue = {'op': 'append', 'value': (4, 'C'), 'state': [(1, 'B'), (4, 'C')]}
[0.002s] dijkstra.py:27 (change) dijkstra.queue = {'op': 'sort', 'args': (), 'kwargs': {}, 'state': [(1, 'B'), (4, 'C')]}
[0.003s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (1, 'B'), 'state': [(4, 'C')]}
[0.003s] dijkstra.py:15 (set) dijkstra.node = 'B'
[0.003s] dijkstra.py:15 (set) dijkstra.current_dist = 1
[0.003s] dijkstra.py:18 (change) dijkstra.visited = {'op': 'add', 'value': 'B', 'state': {'A', 'B'}}
[0.003s] dijkstra.py:21 (set) dijkstra.weight = 2
[0.003s] dijkstra.py:23 (set) dijkstra.new_dist = 3
[0.003s] dijkstra.py:24 (change) dijkstra.distances.C = {'op': 'setitem', 'value': 3, 'state': {'A': 0, 'B': 1, 'C': 3, 'D': inf}}
[0.003s] dijkstra.py:25 (change) dijkstra.queue = {'op': 'append', 'value': (3, 'C'), 'state': [(4, 'C'), (3, 'C')]}
[0.003s] dijkstra.py:21 (set) dijkstra.neighbor = 'D'
[0.003s] dijkstra.py:21 (set) dijkstra.weight = 5
[0.003s] dijkstra.py:23 (set) dijkstra.new_dist = 6
[0.003s] dijkstra.py:24 (change) dijkstra.distances.D = {'op': 'setitem', 'value': 6, 'state': {'A': 0, 'B': 1, 'C': 3, 'D': 6}}
[0.003s] dijkstra.py:25 (change) dijkstra.queue = {'op': 'append', 'value': (6, 'D'), 'state': [(4, 'C'), (3, 'C'), (6, 'D')]}
[0.003s] dijkstra.py:27 (change) dijkstra.queue = {'op': 'sort', 'args': (), 'kwargs': {}, 'state': [(3, 'C'), (4, 'C'), (6, 'D')]}
[0.003s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (3, 'C'), 'state': [(4, 'C'), (6, 'D')]}
[0.003s] dijkstra.py:15 (set) dijkstra.node = 'C'
[0.003s] dijkstra.py:15 (set) dijkstra.current_dist = 3
[0.003s] dijkstra.py:18 (change) dijkstra.visited = {'op': 'add', 'value': 'C', 'state': {'C', 'A', 'B'}}
[0.003s] dijkstra.py:21 (set) dijkstra.weight = 1
[0.003s] dijkstra.py:23 (set) dijkstra.new_dist = 4
[0.003s] dijkstra.py:24 (change) dijkstra.distances.D = {'op': 'setitem', 'value': 4, 'state': {'A': 0, 'B': 1, 'C': 3, 'D': 4}}
[0.003s] dijkstra.py:25 (change) dijkstra.queue = {'op': 'append', 'value': (4, 'D'), 'state': [(4, 'C'), (6, 'D'), (4, 'D')]}
[0.003s] dijkstra.py:27 (change) dijkstra.queue = {'op': 'sort', 'args': (), 'kwargs': {}, 'state': [(4, 'C'), (4, 'D'), (6, 'D')]}
[0.003s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (4, 'C'), 'state': [(4, 'D'), (6, 'D')]}
[0.003s] dijkstra.py:15 (set) dijkstra.current_dist = 4
[0.004s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (4, 'D'), 'state': [(6, 'D')]}
[0.004s] dijkstra.py:15 (set) dijkstra.node = 'D'
[0.004s] dijkstra.py:18 (change) dijkstra.visited = {'op': 'add', 'value': 'D', 'state': {'C', 'A', 'B', 'D'}}
[0.004s] dijkstra.py:27 (change) dijkstra.queue = {'op': 'sort', 'args': (), 'kwargs': {}, 'state': [(6, 'D')]}
[0.004s] dijkstra.py:13 (change) dijkstra.queue = {'op': 'pop', 'index': 0, 'value': (6, 'D'), 'state': []}
[0.004s] dijkstra.py:15 (set) dijkstra.current_dist = 6
[0.004s] dijkstra.py:29 (return) dijkstra = {'A': 0, 'B': 1, 'C': 3, 'D': 4}
You can ofc remove the timer and file by doing toggle_message_metadata(False)