From 3a6d6f886e80101dc63534c85b10e8c31c6fa77f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 6 May 2017 04:24:18 -0400 Subject: [PATCH] image_signing: common.sh: prefix helper messages with $PROG by default This makes the output easier to follow when multiple scripts are being run. BRANCH=None BUG=chromium:714598 TEST=signing images still works Change-Id: I072994dd07cf559a60e8a139eaeaf000cbbf72e3 Reviewed-on: https://chromium-review.googlesource.com/497301 Commit-Ready: Mike Frysinger Tested-by: Mike Frysinger Reviewed-by: David Riley --- scripts/image_signing/common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/image_signing/common.sh b/scripts/image_signing/common.sh index 657b5be2ba..33328612ae 100644 --- a/scripts/image_signing/common.sh +++ b/scripts/image_signing/common.sh @@ -5,6 +5,7 @@ # found in the LICENSE file. . "$(dirname "$0")/common_minimal.sh" +CROS_LOG_PREFIX="${PROG}: " # Array of actions that are executed during the clean up process. declare -a cleanup_actions @@ -50,21 +51,21 @@ V_VIDOFF="\e[0m" # Taken from src/scripts/common.sh. # Arg: MESSAGE info() { - echo -e >&2 "${V_BOLD_GREEN}INFO : $1${V_VIDOFF}" + echo -e >&2 "${V_BOLD_GREEN}${CROS_LOG_PREFIX:-}INFO : $1${V_VIDOFF}" } # Prints a warning message. # Taken from src/scripts/common.sh. # Arg: MESSAGE warn() { - echo -e >&2 "${V_BOLD_YELLOW}WARNING: $1${V_VIDOFF}" + echo -e >&2 "${V_BOLD_YELLOW}${CROS_LOG_PREFIX:-}WARNING: $1${V_VIDOFF}" } # Prints the specified error and exit the script with an error code. # Taken from src/scripts/common.sh. # Args: MESSAGE error() { - echo -e >&2 "${V_BOLD_RED}ERROR : $1${V_VIDOFF}" + echo -e >&2 "${V_BOLD_RED}${CROS_LOG_PREFIX:-}ERROR : $1${V_VIDOFF}" } # Prints an error message and exit with an error code.