Extra verbose python traceback formatting with current variable values (because sometimes there's no debugger, only a log file)
Traceback (most recent call last):
File "tracebacks.py", line 85, in <module>
some_function("hello")
File "tracebacks.py", line 82, in some_function
a_broken_function(foo)
File "tracebacks.py", line 78, in a_broken_function
raise Exception('hello!')
Exception: hello!
(...)
/home/.../projects/tracebacks/tracebacks.py in some_function
76 if k == 9:
77 raise Exception('hello!')
78
79 def some_function(boing):
80 foo = boing + "world"
--> 81 a_broken_function(foo)
82
..................................................
boing = 'hello'
foo = 'helloworld'
..................................................
/home/.../projects/tracebacks/tracebacks.py in a_broken_function
72 list_of_things = [foo, foo]
73 somestring = "yet another string"
74 somearray = rng.randint(0,9,size=(100,100))
75 for k in range(10):
76 if k == 9:
--> 77 raise Exception('hello!')
78
..................................................
foo = 'helloworld'
k = 9
list_of_things = ['helloworld', 'helloworld']
somearray = array([[6, 4, 1, ..., 0, 4, 6],
[5, 7, 0, ..., 4, 3, 2],
[8, 6, 8, ..., 3, 8, 1],
...,
[4, 1, 0, ..., 0, 4, 7],
[6, 5, 1, ..., 5, 6, 4],
[0, 4, 5, ..., 6, 6, 1]])
somestring = 'yet another string'
..................................................
Exception: hello!