Log errors of runner commands only in debug mode #1870
Merged
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.
During any installation we currently have this logs
Where the error message is likely to appear in clearly visible red red. This particular error happens because after running any partition related change in disk run
partx
to reload and update partitions. This is only a best effort call, meaning we ignore any error (if running in a container this is likely to always fail, but doesn't necessarily mean there is an installation error).Given the fact there a few command calls for which we ignore reported errors it doesn't make much sense having the
runner.Run
method to log at error level all command failures, this is caller responsibility to know if this should be logged at error level or not.Hence in this PR on
runner.Run
errors we actually log everything (command error and command output) at debug level. Since the method returns the error and the command output, the caller still has the chance to log error as error level if this is the desired behavior.