How do I record the number of times blender ops returns finished

I am trying to design a Marco layout and I’d like to gather some statistics on my op usage.

The way I see it is to rig the bpy.ops such that it writes to a text file with the name of the ops that returns finished. ( I might add logic to handle the aggregation but for now I will just handle it outside the script. )

Any pointers?

it’s python, you can just open up a file and write to it anytime you like (right before your operator exits, for example). If you’re asking for some kind of generic ‘callback’ you can hook into, it doesn’t exist.