From: Philippe Proulx Date: Fri, 12 Apr 2019 21:15:38 +0000 (-0400) Subject: BT_ASSERT(): update rendering X-Git-Tag: v2.0.0-pre5~100 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=89c649f6a61ef564650e2617a42e304750aa609a BT_ASSERT(): update rendering * Move flip-table emoji at the beginning. * Make flip-table emoji compatible with terminals which do not support combining diacritics. * Colorize file name, line number, and function name independently. * Add `()` after function name. * Make the whole "Assertion `...` failed." red, but the message itself bold. Signed-off-by: Philippe Proulx --- diff --git a/common/assert.c b/common/assert.c index d02e9113..ebc98769 100644 --- a/common/assert.c +++ b/common/assert.c @@ -28,9 +28,28 @@ void bt_common_assert_failed( bt_common_color_bold(); bt_common_color_fg_red(); fprintf(stderr, - "%s%s:%d: %s: Assertion %s`%s`%s failed. (╯ ͡° □ ͡°)╯︵ ┻━┻%s\n", - bt_common_color_bold(), file, line, func, - bt_common_color_fg_red(), assertion, - bt_common_color_fg_default(), bt_common_color_reset()); + "%s\n%s%s%s (╯°□°)╯︵ ┻━┻ %s %s%s%s%s:%s%d%s: %s%s()%s: " + "%sAssertion %s`%s`%s%s failed.%s\n", + bt_common_color_reset(), + bt_common_color_bold(), + bt_common_color_bg_yellow(), + bt_common_color_fg_red(), + bt_common_color_reset(), + bt_common_color_bold(), + bt_common_color_fg_magenta(), + file, + bt_common_color_reset(), + bt_common_color_fg_green(), + line, + bt_common_color_reset(), + bt_common_color_fg_cyan(), + func, + bt_common_color_reset(), + bt_common_color_fg_red(), + bt_common_color_bold(), + assertion, + bt_common_color_reset(), + bt_common_color_fg_red(), + bt_common_color_reset()); abort(); -} \ No newline at end of file +}