added the quiet (-q) param to suppress progress output #41
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.
Motivation
Currently, the progress output is embedded in the RealSR object, and cannot be controlled. This creates problems especially when the program is used as a library as it will spam lots of messages onto the screen. While it is possible to suppress the messages by suppressing STDERR entirely, it will also suppress error messages, which is undesirable.
Behavior Before the Update
Before any changes are made, realsr-ncnn-vulkan will print the progress of the current task:
Proposed Changes
I am proposing to add a new param
-q
(quiet) to suppress the progress output. From a consistency standpoint, I'd rather make the output suppressed by default. However, I'd like to not alter the program's default behavior in this PR and leave the choice to @nihui.Behavior After the Update
A new parameter
quiet
is added to the RealSR class to control the suppression of progress output. This can also be controlled with the new-q
argument in the command line argument parser.After adding the
-q
param, the progress output can be suppressed like such:Remarks
I've never written any serious C++ before, so my apologies if I've made any mistakes in the changes.