If you need a quick solution, detective-snapshot does exactly this. Just add @snapshot() to your functions:
from detective import snapshot
class Api
@snapshot()
def insertVideoEntry(self, video_entry, video):
...
@snapshot()
def foo():
...
@snapshot()
def baz2():
...
if DEBUG=true
, you'll get a JSON file showing exactly what got called and in what order
{
"FUNCTION": "insertVideoEntry",
"INPUTS": {
"video_entry": {...},
"video": {...}
},
"CALLS": [
{
"FUNCTION": "foo",
"CALLS": [
{
"FUNCTION": "bar",
"CALLS": [
{"FUNCTION": "baz"},
{"FUNCTION": "baz2"}
]
},
{"FUNCTION": "log"}
]
},
{"FUNCTION": "finish"}
]
}