From fdd4289969e50ddb424b49ac172e446f89ab0e2e Mon Sep 17 00:00:00 2001 From: Martin Kulhavy Date: Tue, 8 Aug 2017 14:27:33 +0300 Subject: Improve and highlight logging to console xtrace produces a lot of output that can be hard to read. This commit adds a function to print important information messages in bold yellow, so that they stand out in the log and make it easier for the user to understand what is currently happening. Change-Id: I78d3dbd909beca30b36723b879b13436932629f9 Signed-off-by: Martin Kulhavy --- ci/tools.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ci/tools.sh (limited to 'ci/tools.sh') diff --git a/ci/tools.sh b/ci/tools.sh new file mode 100644 index 00000000..4eed361b --- /dev/null +++ b/ci/tools.sh @@ -0,0 +1,26 @@ +############################################################################## +# Copyright (c) 2017 Nokia and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +####################################### +# Echo printing in yellow bold color +# Arguments: +# Same as for echo +# Returns: +# None +####################################### +function echo_info { ( + # don't clutter the script output with the xtrace of the echo command + { set +x; } 2> /dev/null + + yellow_bold='\033[1;33m' + color_off='\033[0m' + echo "${@:1:($#-1)}" -e "$yellow_bold${@: -1}$color_off"; + ) +} -- cgit 1.2.3-korg