Fix errors not printed#4116
Conversation
fce79d3 to
ddf60cd
Compare
|
Meanwhile, I found a solution that doesn't print twice on the console. But the message in the console is not translated any more. See last commit ddf60cd @BsAtHome Which version do you think is better? In the below images, I first trigger an error using Edit: There was a bug visible in the image. Fixed in force push. |
Where in the chain is the translation performed? |
I have no clue how this works. |
Instead of inhibiting old_handler() we always use old_handler() for console in real time context and inhibit print to console for messages passed from realtime to milltask.
ddf60cd to
9c1a6b2
Compare
Ah now, that one was well hidden: Before this line it is untranslated, after it is translated: linuxcnc/src/emc/motion/usrmotintf.cc Line 218 in 3cd702c The translation is here: linuxcnc/src/emc/motion/stashf_wrap.h Line 29 in 3cd702c And if %s is used, it is here: linuxcnc/src/emc/motion/stashf_wrap.h Line 85 in 3cd702c snprintdbuf() is a good name for translating text... ;-) |
|
Tests with RTAI show one change: If desired, there is probably a way to enable the terminal errors for RTAI, but they are anyway shown in the GUI. |
|
Is this still draft, or good to go? |


This fixes #3948
The commit ddf60cd inhibits printing twice by always using old_handler() to print from motion and inhibits console print for motion->milltask messages. TBD if this is fine like this. Otherwise, I would just accept that errors are printed twice. Better than not at all.
Some options I tried and then discarded:
Add a flag to emcmot_error_t that shows if milltask is up and running and only invoke old_handler() if milltask is not running
Inhinibit print to console by flag in milltask