[runSofa] Main: add an option "quiet" , ignoring info messages at start-up - #6295
Open
fredroy wants to merge 2 commits into
Open
[runSofa] Main: add an option "quiet" , ignoring info messages at start-up#6295fredroy wants to merge 2 commits into
fredroy wants to merge 2 commits into
Conversation
Contributor
Author
|
[ci-build][with-all-tests] |
Collaborator
|
[ci-depends-on] detected during build #2. To unlock the merge button, you must
|
fredroy
force-pushed
the
runsofa_quiet
branch
from
September 8, 2026 02:28
748718a to
8ec6a15
Compare
Collaborator
|
[ci-depends-on] detected during build #3. To unlock the merge button, you must
|
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.
IMO I think runSofa can be really too verbose, especially with the number of loaded plugins.
So this PR is a proposal to add a quiet flag, which ignores the [INFO] message coming from somewhere else than the Simulation itself, aka loadplugins, paths, ini config... It will still print the other types of messages (warning, deprecation, advise, error....)
It was already implemented on the Simulation side, with the "printLog=false" but this mechanism is only implemented in the
PerComponentLoggingMessageHandlerclass.I needed to modify the MessageHandler base class to add the filter for all the handlers. Note that even PerComponentLoggingMessageHandler do its job (i.e printing INFO message when true) even if the flag "quiet" is set, because runSofa restores the default behavior before the init() stage.
Did some small refactoring in runSofa about the instanciations of the handlers too (would need to use shared_ptr one day, but not the purpose of the PR)
Example of output with the default scene, no other option:
without the flag (102 lines)
with the flag (12 lines)
Breaking because this is changing the API of MessageHandler
[with-all-tests]
[ci-depends-on https://github.com/sofa-framework/SofaPython3/pull/637]
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if