How to log click on a button in segment editor?

Hello everyone, while trying to create personal module for slicer a problem occured. I need to log then the user click on “add” button in segment editor and changes tools. I want to create a timer, which will log how long it takes to make a segment. A lost hope to create the whole extension, but still want to make it work through built-in console. Any suggestions on how to log buttons?

User Statistics module in Sandbox extension collects data about what modules are used, which Segment Editor effects are used and for how long, on what segments. It takes into account idle time (if the user leaves the computer or switches to another application then the clock stops). It is a Python scripted module, so you can extend it to record any additional details.

Thank you! We are currently trying to use this module in our work, or adapt its functions to our purposes. I hope it is possible for me not to mark the problem as solved right now, because I am sure, that I’ll face something again.

Thank you again for your reply. It was exciting experience. The feature was realized)

Great to hear that you managed to implement what you needed. If you think this could be a useful feature in general then I would encourage tou to contribute it back to the community by sending a pull request to the Sandbox repository with your proposed changes.