From 55a4517d65a04eec5a5167ebac214336d262d63f Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 23 Oct 2013 15:08:49 -0700 Subject: [PATCH] fix(common.sh): Use $SCRIPT_NAME as the default log prefix. Seems useful with all the scripts-calling-scripts-turtles but very few scripts explicitly set a prefix. --- common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.sh b/common.sh index da89510005..b1cba1c95f 100644 --- a/common.sh +++ b/common.sh @@ -76,10 +76,10 @@ _dump_trace() { # Declare these asap so that code below can safely assume they exist. _message() { - local prefix=$1 + local prefix="$1${CROS_LOG_PREFIX:-${SCRIPT_NAME}}" shift if [[ $# -eq 0 ]]; then - echo -e "${prefix}${CROS_LOG_PREFIX:-""}:${V_VIDOFF}" >&2 + echo -e "${prefix}:${V_VIDOFF}" >&2 return fi ( @@ -95,7 +95,7 @@ _message() { set -- '' fi for line in "$@"; do - echo -e "${prefix}${CROS_LOG_PREFIX:-}: ${line}${V_VIDOFF}" >&2 + echo -e "${prefix}: ${line}${V_VIDOFF}" >&2 done ) }