1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-31 05:47:30 +03:00

busctl: do not print start/stop monitoring messages with --quiet/--json

This commit is contained in:
Luca Boccassi 2023-08-30 18:56:07 +01:00 committed by Luca Boccassi
parent b0881b65a6
commit a699b1e7a9

View File

@ -1308,7 +1308,8 @@ static int monitor(int argc, char **argv, int (*dump)(sd_bus_message *m, FILE *f
if (r < 0)
return log_error_errno(r, "Failed to get unique name: %m");
log_info("Monitoring bus message stream.");
if (!arg_quiet && arg_json_format_flags == JSON_FORMAT_OFF)
log_info("Monitoring bus message stream.");
for (;;) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
@ -1339,7 +1340,8 @@ static int monitor(int argc, char **argv, int (*dump)(sd_bus_message *m, FILE *f
fflush(stdout);
if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected") > 0) {
log_info("Connection terminated, exiting.");
if (!arg_quiet && arg_json_format_flags == JSON_FORMAT_OFF)
log_info("Connection terminated, exiting.");
return 0;
}