Debugging undo stack issues

What is the best way to debug issues with the undo stack. I have a certain circumstance that adds three items to the undo stack. I would like to do something like puts, so I can check in my code where the items are being added. I think the issue is most likely in an observer, but I’m unsure how to tell because when stepping through the code SketchUp is froze, and I can’t check the undo menu in the UI.

There is the log text file that is written into by SketchUp. In the LocalAppData/temp folder.
You can sometimes watch that file using a logfile viewer utility or an editor.

The undo stack is not itself exposed to the APIs. We have long asked to be able to get the current undo operation’s name, but it hasn’t yet been implemented.

The only notifications of transactions is via a Sketchup::ModelObserver object.

onTransactionStart (model) might be useful if the transaction name would be passes as an argument.

The log doesn’t look particularly useful in this case.

You can read the name of the last transaction in both the Undo and Redo stack in the Edit menu. This is not exposed by the API though.

I know. I was hoping for some sort of hack I guess. I was able to find my problem, but it would have been easier if I could have checked the undo stack from the api.

Well, on Windows you could use a MS MFC C function call to perhaps read the Edit menu captions.

From all the undo’s I find ‘reparent’ the most intriguing one
Of topic, srry!