Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silence debug message #2738

Merged
merged 2 commits into from
Nov 7, 2023
Merged

silence debug message #2738

merged 2 commits into from
Nov 7, 2023

Conversation

heeplr
Copy link
Contributor

@heeplr heeplr commented Nov 7, 2023

As promised:

  • silence NML constructor debug output when not debugging
  • improve iniLoad() debug output and move inside iniLoad()

@andypugh andypugh merged commit 1259099 into LinuxCNC:master Nov 7, 2023
11 checks passed
@phillc54
Copy link
Collaborator

phillc54 commented Nov 8, 2023

Thank you, that looks good.

Is it possible to get the task: message to show only once, I get it three times which seems a bit excessive.

Screenshot 2023-11-08 at 2 24 06 pm

@heeplr
Copy link
Contributor Author

heeplr commented Nov 8, 2023

This is caused because the INI config is parsed by multiple processes from emcsvr.cc, emctaskmain.cc, halui.cc and shcom.cc since they use the same code. So depending on your configuration, you see the output multiple times.

Part of this is actually a copy/paste bug - it shouldn't say "task" three times. Thanks for pointing my nose at it ;)

So I wouldn't say it's excessive but I agree that it doesn't make a lot of sense like that since it's pretty redundant right now.
Could you bare with the output if it would include the processname and pid? That way, the message would indicate that the config was parsed in the specific process. It would look like this:

linuxcncsvr (4326) emcsvr: machine 'my_mill'   version 'unknown'
...
milltask (4329) emctask: machine 'my_mill'   version 'unknown'
...
linuxcncrsh (4329) shcom: machine 'my_mill'   version 'unknown'

That way, every process would indicate which machine config is parsed. (I used that when testing multiple configs on different hosts without using scripts/linuxcnc.)

If we remove all messages but one, there might be two candidates: emcsvr.cc and emctaskmain.cc since they run always. But when using remote processes, emctask (milltask) is not run on every host. That leaves only emcsvr.cc which is always run on every host. (Although it doesn't need to run afais, when there are no remote processes configured so this might change in the future).

Also the iniLoad() code should actually be deduplicated at one point. When that happens, all processes will call the same function which would output the message for every process again.

I'd prefer keeping them with additional name/pid output but I don't really have a strong opinion on that.

@heeplr heeplr deleted the silent-debug branch November 16, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants