RAFCON icon indicating copy to clipboard operation
RAFCON copied to clipboard

Debug Console: Link output to states / code / history that generated it

Open franzlst opened this issue 4 years ago • 1 comments

It would be a convenient feature if you could (double-)click on a log message in the debug console to

  • [ ] open the state that triggered it
  • [ ] go to the line of code that sent the message
  • [ ] open the respective part of the execution history

Originally created by @mjschuster at 2019-07-16 09:00:34+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

I guess this won't happen in the near future (although I think it would be could).

Nevertheless, I tried to find out, how this could be implemented:

When calling debug, info, etc, one can specify an additional keyword argument extra. Here, a dict can be passed, which in our case could be something like {'state': weakref.ref(state)}. This way, a weak reference to the state would be stored in the LogRecord, where it could be accessed by the LoggingViewer.

Originally created by @franzlst ([email protected]) at 2019-07-16 14:36:21+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst