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

wxGUI: Ignore stderr of the GUI #3049

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

wenzeslaus
Copy link
Member

When GUI is started by the init (grass.py) script, error messages comming from wxGUI are now ignored. The messages can be inspected by setting GRASS_DEBUG.

There is many GTK critical messages which seem very critical, but are harmless for the end user and we had little luck in fixing them, perhaps because we are using GTK only through wxPython and not directly. Complains about the messages far outnumber complains about non-functional widgets on GTK, so hiding the messages not relevant to the end user by default makes sense. Other programs typically don't face this issue as they are not started from terminal or they use daemon process for the main process, so it's unclear what is the common practice except for the result being no messages are typically visible to the end user.

When GUI is started by the init (grass.py) script, error messages comming from wxGUI are now ignored. The messages can be inspected by setting GRASS_DEBUG.

There is many GTK critical messages which seem very critical, but are harmless for the end user and we had little luck in fixing them, perhaps because we are using GTK only through wxPython and not directly. Complains about the messages far outnumber complains about non-functional widgets on GTK, so hiding the messages not relevant to the end user by default makes sense. Other programs typically don't face this issue as they are not started from terminal or they use daemon process for the main process, so it's unclear what is the common practice except for the result being no messages are typically visible to the end user.
@landam landam added this to the 8.4.0 milestone Jul 3, 2023
@landam landam added the GUI wxGUI related label Jul 3, 2023
@landam
Copy link
Member

landam commented Jul 3, 2023

Q: GUI should probably reflect WX_DEBUG rather that (GRASS_)DEBUG(?)

@landam
Copy link
Member

landam commented Jul 3, 2023

Unfortunately g.gui is not affected by this PR, but it's probably another "story".

@wenzeslaus
Copy link
Member Author

Q: GUI should probably reflect WX_DEBUG rather that (GRASS_)DEBUG(?)

OK, makes sense, done. That's indeed expected when debugging GUI (although you are likely to use g.gui in that case anyway). I tested that and it works as expected.

I'm keeping GRASS_DEBUG. GRASS_DEBUG is much more convenient way to just get the stderr back and it gets it without all the wxGUI debug messages. It is also what works everywhere else in the main script.

@wenzeslaus
Copy link
Member Author

...g.gui is not affected by this PR...

I didn't do any test, but I think it needs to be solved from the caller process, so g.gui really needs to be done separately.

Maybe we want to keep g.gui with stderr for some (limited) time. It is the more advanced or less standard way of using the GUI anyway, so perhaps we want the exposure to the messages there. I hope at least some can be solved.

@wenzeslaus
Copy link
Member Author

The code is ready to be merged and the change seems to have support.

@echoix
Copy link
Member

echoix commented Dec 22, 2023

Is this PR still up to date, and appropriate to merge?

@github-actions github-actions bot added Python Related code is in Python libraries and removed GUI wxGUI related labels Jan 27, 2024
@echoix
Copy link
Member

echoix commented Jan 27, 2024

This PR was previously reviewed and approved and was once ready to merge. Is there anything that should block merging this now? A refresh of the CI was triggered with the new required checks in place since then.

@echoix echoix added the GUI wxGUI related label Jan 27, 2024
@echoix
Copy link
Member

echoix commented Feb 1, 2024

@lindakladivova Does this come break what you are working on? Does this seem right to merge for you, since you are actively in the GUI side of the codebase?

@lindakarlovska
Copy link
Contributor

@lindakladivova Does this come break what you are working on? Does this seem right to merge for you, since you are actively in the GUI side of the codebase?

From my side, this PR looks okay but I was not actively present during its implementation, maybe @landam / @wenzeslaus should merge it?

@petrasovaa petrasovaa merged commit 5e3858b into OSGeo:main Feb 2, 2024
23 checks passed
jadenabrams100 pushed a commit to ncsu-csc472-spring2024/grass-CI-playground that referenced this pull request Feb 21, 2024
When GUI is started by the init (grass.py) script, error messages coming from wxGUI are now ignored. The messages can be inspected by setting GRASS_DEBUG.

There is many GTK critical messages which seem very critical, but are harmless for the end user and we had little luck in fixing them, perhaps because we are using GTK only through wxPython and not directly. Complains about the messages far outnumber complains about non-functional widgets on GTK, so hiding the messages not relevant to the end user by default makes sense. Other programs typically don't face this issue as they are not started from terminal or they use daemon process for the main process, so it's unclear what is the common practice except for the result being no messages are typically visible to the end user.

* React to GRASS GIS environment WX_DEBUG besides system environment variable GRASS_DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related libraries Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants