Repository navigation
rtapi: end an error or warning that lacks the newline - #4697
Open
grandixximo wants to merge 1 commit into
Open
grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
An error or a warning whose text does not end in a newline ran on into the next message, so a repeated homing error read "j2 end of move in home state 5j2 end of move in home state 5" (LinuxCNC#4689). 58 error and warning formats in the tree lack the newline, and their translations match them. The default message handlers of uspace now add the newline where they print: in the main thread of rtapi_app, in the queue for messages from its realtime threads, and in user processes. Only errors and warnings get it. Info and debug messages, and rtapi_print(), may build a line from several calls, as motion's debug output, the PPMC driver and rtapi_app's cpuset report do. RTAI kernel modules are not changed. tests/rtapi-msg-newline prints errors and a warning without a newline from the main thread of rtapi_app and from a realtime thread, and an info line in two parts.
Contributor
|
It is probably a good thing to enforce a newline but it can have side effects. A few things to consider: linuxcnc/src/emc/motion/homing.c Line 282 in eab7726 The _( including #define _(s) (s) can probably be removed as long as homing.c is only used in realtime context.
There are some places like this: linuxcnc/src/emc/motion/command.c Line 2136 in b99baf8 linuxcnc/src/rtapi/uspace_rtapi_app.cc Line 252 in b99baf8 This cases will now produce to many newlines or clobbered messages. As soon as motion is running, messages go trough a different path: linuxcnc/src/emc/motion/motion.c Line 460 in b99baf8 linuxcnc/src/emc/motion/motion.c Line 247 in b99baf8 As much as I remember, this path to the gui goes to translation and adds a newline always. That's why the GUI pop-up's often have a newline to much. But a lot was changed since I touched it in #4116. |
Contributor
Author
|
@hdiethelm thanks for looking. In order:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4689. @BsAtHome, this is your idea of fixing it where the message is printed. @hdiethelm, thanks for the report.
The uspace default message handlers now add a missing newline where they print: in the main thread of rtapi_app, in the queue that prints the messages of its realtime threads, and in user processes. Only errors and warnings get it. Info and debug messages and
rtapi_print()may build one line from several calls, as motion's debug output, the PPMC driver and rtapi_app's cpuset report do, so they are left as they are. The 58 error and warning formats without the newline, and their translations, do not change. RTAI kernel modules are not changed.tests/rtapi-msg-newlineprints errors and a warning without a newline from the main thread of rtapi_app and from a realtime thread, and an info line in two parts. On master all of it comes out as one line. The full suite passes apart from blendmath, which does not build with GCC 14 (#4676).