diff --git a/salt/common/tools/sbin/so-analyst-install b/salt/common/tools/sbin/so-analyst-install index eb6fdb353..f59105293 100755 --- a/salt/common/tools/sbin/so-analyst-install +++ b/salt/common/tools/sbin/so-analyst-install @@ -23,6 +23,21 @@ fi INSTALL_LOG=/root/so-analyst-install.log exec &> >(tee -a "$INSTALL_LOG") +log() { + msg=$1 + level=${2:-I} + now=$(TZ=GMT date +"%Y-%m-%dT%H:%M:%SZ") + echo -e "$now | $level | $msg" >> "$INSTALL_LOG" 2>&1 +} + +error() { + log "$1" "E" +} + +info() { + log "$1" "I" +} + title() { echo -e "\n-----------------------------\n $1\n-----------------------------\n" >> "$INSTALL_LOG" 2>&1 }