If all you need is input/output/exception/calls of your function chain, try pip install detective-snapshot
.
Add @snapshot()
decorator to the functions you want to track, and it will log structured JSON files like this for each run of flip_coin (or whichever is your entrypoint function)
{
"FUNCTION": "flip_coin",
"INPUTS": {
"ctx": {
"message": {
"author": "CoolUser#1234"
}
}
},
"OUTPUT": "Tails",
"CALLS": [
{
"FUNCTION": "random.randint",
"INPUTS": {
"a": 1,
"b": 2
},
"OUTPUT": 2
},
{
"FUNCTION": "currentTime",
"INPUTS": {},
"OUTPUT": "2024-02-22 15:30:45"
},
{
"FUNCTION": "bot.say",
"INPUTS": {
"message": "Tails"
},
"OUTPUT": null
}
]
}