Skip to content

Comments

Suppress the display of informative messages when wanting to display the result of --print-info <info flags>#1053

Merged
stefanberger merged 3 commits intomasterfrom
stefanberger/suppress_logging_getinfo
Aug 18, 2025
Merged

Suppress the display of informative messages when wanting to display the result of --print-info <info flags>#1053
stefanberger merged 3 commits intomasterfrom
stefanberger/suppress_logging_getinfo

Conversation

@stefanberger
Copy link
Owner

Avoid displaying informative message when displaying the JSON result of a --print-info request to avoid mixing the JSON with regular text messages.

@stefanberger stefanberger force-pushed the stefanberger/suppress_logging_getinfo branch 2 times, most recently from 0fcac75 to 6c27a95 Compare August 18, 2025 16:08
When the special logging file descriptor SUPPRESS_INFO_LOGGING is chosen,
then only suppress informative and warning messages while still allowing
error messages to be printed to stderr.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Have warnings print to stdout since they do not lead to swtpm exiting with
an error code.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger force-pushed the stefanberger/suppress_logging_getinfo branch 2 times, most recently from 8861487 to 93b0919 Compare August 18, 2025 16:59
When printing the output of the info flags, the resuling JSON printed to
stdout should be the only printout. Therefore, suppress all informative
output to stdout so that either the JSON is the only output or only error
messages are printed.

Fixes: 3f551e1 ("swtpm: Implement --print-info to run TPMLIB_GetInfo with flags")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
@stefanberger stefanberger force-pushed the stefanberger/suppress_logging_getinfo branch from 93b0919 to 7158def Compare August 18, 2025 17:51
@stefanberger stefanberger merged commit 3d5d0f2 into master Aug 18, 2025
5 checks passed
@stefanberger stefanberger deleted the stefanberger/suppress_logging_getinfo branch August 18, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant