79459925

Date: 2025-02-22 16:35:37
Score: 1.5
Natty:
Report link

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"}
  ]
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • User mentioned (1): @snapshot
  • Low reputation (1):
Posted by: user21748703