From 2d92a1f41481fe775468f2aee62fe54160ad8872 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 28 Feb 2019 20:17:48 -0500 Subject: [PATCH] sink.text.pretty: "discarded a number of X" -> "might have discarded X" I believe this is a better wording. Signed-off-by: Philippe Proulx --- plugins/text/pretty/print.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/text/pretty/print.c b/plugins/text/pretty/print.c index 25565df8..389498af 100644 --- a/plugins/text/pretty/print.c +++ b/plugins/text/pretty/print.c @@ -1214,6 +1214,7 @@ int print_discarded_elements_msg(struct pretty_component *pretty, bt_uuid trace_uuid; int64_t stream_class_id; int64_t stream_id; + const char *init_msg; /* Stream name */ stream_name = bt_stream_get_name(stream); @@ -1243,16 +1244,22 @@ int print_discarded_elements_msg(struct pretty_component *pretty, /* Format message */ g_string_assign(pretty->string, ""); + + if (count == UINT64_C(-1)) { + init_msg = "Tracer may have discarded"; + } else { + init_msg = "Tracer discarded"; + } + g_string_append_printf(pretty->string, - "%s%sWARNING%s%s: Tracer discarded ", + "%s%sWARNING%s%s: %s ", bt_common_color_fg_yellow(), bt_common_color_bold(), bt_common_color_reset(), - bt_common_color_fg_yellow()); + bt_common_color_fg_yellow(), init_msg); if (count == UINT64_C(-1)) { - g_string_append_printf(pretty->string, "a number of %ss", - elem_type); + g_string_append_printf(pretty->string, "%ss", elem_type); } else { g_string_append_printf(pretty->string, "%" PRIu64 " %s%s", count, elem_type, -- 2.34.1