Skip to content

Conversation

@hansu
Copy link
Member

@hansu hansu commented Sep 19, 2024

Currently in gmocappy you get a lot of warnings from the logger of the QT_ISTAT instances which are not relevant for gmoccapy.
The more VCPs you are using the more (non-relevant) log messages you get, which makes it hard to focus on the real debug messages you want to see.
So I looked for a way to suppress these warnings.

I added an INI setting which can control this:
VCP_LOGLEVEL = ERROR

I am open for other suggestions...

Furthermore I set the default level of the logger itself to WARNING like the default value of all the others which are using the logger.

In INI file with
[DISPLAY]
VCP_LOGLEVEL = <log_level>
With <log_level> =  one of DEBUG, INFO, WARNING, ERROR, CRITICAL
To reduce the number of default log outputs and to be consistent with the other instances of the logger.
@c-morley
Copy link
Collaborator

I don't think we need to add another ini log level setting. Gmccapy and glavevcp should set the level with there own debug switches.
I though gmoccspy already did this.

Gladevcp and Qtvcp should not complain about INI settings if no INI has been given.
This probably needs some work.

Maybe we could get our heads together and decide on common ini requirements rather then each GUI having it's own similar one.
We could even make a common GUI INI parser like GStat is fir status messages.

@hansu
Copy link
Member Author

hansu commented Sep 19, 2024

Thanks for your feedback.

Gmccapy and glavevcp should set the level with there own debug switches.
I though gmoccspy already did this.

Yes without DISPLAY = gmoccapy -q I would get even more log messages.

Gladevcp and Qtvcp should not complain about INI settings if no INI has been given.

I currently get this mass of log messages because I have some VCPs integrated:
And I get all warnings repeated for each VCP. That's a bit annoying.

[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
....
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No DEFAULT_SPINDLE_0_SPEED Entry in DISPLAY, Using: 200 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_SPEED Entry in DISPLAY, Using: 100 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_SPEED Entry in DISPLAY, Using: 2500 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 1 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 0.5 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No DEFAULT_SPINDLE_0_SPEED Entry in DISPLAY, Using: 200 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_SPEED Entry in DISPLAY, Using: 100 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_SPEED Entry in DISPLAY, Using: 2500 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 1 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 0.5 (qt_istat.py:532)
[GladeVCP.GMOCCAPY.GETINIINFO][INFO]  Preference file path: /home/cnc/linuxcnc/configs/Sieg-X1/Sieg-X1.pref (getiniinfo.py:74)
144703491
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No DEFAULT_SPINDLE_0_SPEED Entry in DISPLAY, Using: 200 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_SPEED Entry in DISPLAY, Using: 100 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_SPEED Entry in DISPLAY, Using: 2500 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 1 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 0.5 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No DEFAULT_SPINDLE_0_SPEED Entry in DISPLAY, Using: 200 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_SPEED Entry in DISPLAY, Using: 100 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_SPEED Entry in DISPLAY, Using: 2500 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MAX_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 1 (qt_istat.py:532)
[GladeVCP.QTVCP.QT_ISTAT][WARNING]  INI Parsing Error, No MIN_SPINDLE_0_OVERRIDE Entry in DISPLAY, Using: 0.5 (qt_istat.py:532)

Maybe we could get our heads together and decide on common ini requirements rather then each GUI having it's own similar one.
We could even make a common GUI INI parser like GStat is fir status messages.

Sounds good 👍

@c-morley
Copy link
Collaborator

Remind me .. integrated vcps require a separate gladevcp Instance (embedded) or does gmoccapy integrate the gladevcp directly into gmoccapy's instance?
What I'm getting at is if there are separate gladevcp loading commands that is where the logging level should be set.
In my opinion warnings should not show if in quiet mode and I think that us how it works now. Can you add -q and remove the warnings?

@hansu
Copy link
Member Author

hansu commented Sep 21, 2024

Remind me .. integrated vcps require a separate gladevcp Instance (embedded) or does gmoccapy integrate the gladevcp directly into gmoccapy's instance?

One gladevcp instance is embedded in gmoccapy - you get that even without VCPs

Can you add -q and remove the warnings?

No, gladevcp doesn't have that option. Only qtvcp has this.
But If I add this to gladevcp - it doesn't change anything because the log messages come from qt_istat.py.
And I don't know how resp. why this file is involved when using gladevcp without QT ...

@c-morley
Copy link
Collaborator

@andypugh
Copy link
Collaborator

This level of output does seem excessive, but on the other hand it's potentially useful info, hinting that the integrator really ought to have put some data in the INI.

I am guessing we don't have an "INFO" level? "WARNING" seems a little too serious for these.

@hansu
Copy link
Member Author

hansu commented Sep 22, 2024

[Andy]

I am guessing we don't have an "INFO" level? "WARNING" seems a little too serious for these.

Yes we have but I think WARNING is ok as we also have ERROR and CRITICAL above.

[Chris]

try this:
https://github.com/LinuxCNC/linuxcnc/tree/gmoccapy_gladevco_logging_fix

I think it's a good solution together with #2335

Expect that I still get those lines, one for every loaded VCP:

[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)
[GladeVCP][INFO]  Logging to: /home/cnc/gladevcp.log (logger.py:106)

@hansu
Copy link
Member Author

hansu commented Sep 22, 2024

Maybe we could get our heads together and decide on common ini requirements rather then each GUI having it's own similar one.
We could even make a common GUI INI parser like GStat is fir status messages.

We should make _IStat more universal. See my comments in #2335 (comment)

@hansu
Copy link
Member Author

hansu commented Sep 23, 2024

try this: https://github.com/LinuxCNC/linuxcnc/tree/gmoccapy_gladevco_logging_fix

Can you push that to master or make a pull request?

@andypugh
Copy link
Collaborator

Where are we with this? Is the suggestion in the link above something to merge instead of this PR, or in addition to this PR?

@hansu
Copy link
Member Author

hansu commented Sep 23, 2024

Where are we with this? Is the suggestion in the link above something to merge instead of this PR, or in addition to this PR?

That commit resolves my issue to 90%, so yes instead

@c-morley
Copy link
Collaborator

try this: https://github.com/LinuxCNC/linuxcnc/tree/gmoccapy_gladevco_logging_fix

Can you push that to master or make a pull request?

Pushed this to master now.

As for the multiple:
[GladeVCP][INFO] Logging to: /home/chris/gladevcp.log (logger.py:106)

First do you think it would be better to log to different files (maybe by adding the gladevcp object name) for each gladevcp instance?
or
Do we even need to log to a file at all?

@hansu
Copy link
Member Author

hansu commented Sep 24, 2024

Do we even need to log to a file at all?

Not really as we usually don't have a logger in the VCPs.

For me the log file only contains

GladeVCP - INFO Logging to: /home/cnc/gladevcp.log

So I think it's safe to disable/remove logging for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants