From 4eea0a464cd6822c5a06877cbff2ba5c23742cb7 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 6 Oct 2020 10:57:43 -0400 Subject: [PATCH] include remaining log functions from so-functions --- salt/common/tools/sbin/so-analyst-install | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 }