3

I want to log everything:

  1. Function entered + values of parameters + function exited
  2. Result of every assignment or operation
  3. etc.

Is it possible to log "everything" in a Python execution without instrumenting the code?

Since things are executing in a VM, it should be possible to configure this at the VM level (hopefully?).

I'm using Pycharm but I could do it via commandline it it's necessary.

There's this existing question: How to do logging at function entry, inside and exit in Python but it doesn't address how to log the result of variable assignments.

Community
  • 1
  • 1
Bob
  • 4,576
  • 7
  • 39
  • 107

1 Answers1

0

You would need to use the trace module and/or perhaps the pdb module. They may not give you everything you need, but it would be a starting point. The logging module doesn't work at such a low level as you seem to want.

Vinay Sajip
  • 95,872
  • 14
  • 179
  • 191