How to find the source of a transaction?

I have an unexpected transaction when inserting some nodes, I want to check which part in prosemirror or my code trigger this transaction, is there any tools or infos I can get?

Running console.trace() in, say, a field apply method might help.