Merge "Package log_functions.sh into platform-util"

This commit is contained in:
Zuul 2018-12-11 15:22:04 +00:00 committed by Gerrit Code Review
commit bf238b235a
1 changed files with 0 additions and 45 deletions

View File

@ -1,45 +0,0 @@
#!/bin/bash
################################################################################
# Copyright (c) 2013-2015 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
################################################################################
# Log if debug is enabled via LOG_DEBUG
#
################################################################################
function log_debug {
if [ ! -z "${LOG_DEBUG}" ]; then
logger -p debug -t "$0[${PPID}]" -s "$@" 2>&1
fi
}
################################################################################
# Log unconditionally to STDERR
#
################################################################################
function log_error {
logger -p error -t "$0[${PPID}]" -s "$@"
}
################################################################################
# Log unconditionally to STDOUT
#
################################################################################
function log {
logger -p info -t "$0[${PPID}]" -s "$@" 2>&1
}
################################################################################
# Utility function to print the status of a command result
#
################################################################################
function print_status {
if [ "$1" -eq "0" ]; then
echo "[ OK ]"
else
echo "[FAILED]"
fi
}