From 18af77ba26d98d6925b8f3b5d95086fcc22d2edb Mon Sep 17 00:00:00 2001 From: jutty Date: Thu, 18 Jul 2024 09:13:18 -0300 Subject: [PATCH] Use echo over printf on logging function --- src/utility.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utility.sh b/src/utility.sh index 868ed91..99746a7 100644 --- a/src/utility.sh +++ b/src/utility.sh @@ -4,12 +4,12 @@ log() { local level="$1" local message="$2" - if [ $level = fatal ]; then - printf "[tori] $(date "+%H:%M:%S"): $message\n" 1>&2 - elif [ $level = user ]; then - printf "[tori] $(date "+%H:%M:%S"): $message\n" 1>&2 - elif [ -n "$DEBUG" ] && [ $level = debug ]; then - printf "$(date "+%H:%M:%N") $message\n" 1>&2 + if [ "$level" = fatal ]; then + echo "[tori] $(date "+%H:%M:%S"): $message" 1>&2 + elif [ "$level" = user ]; then + echo "[tori] $(date "+%H:%M:%S"): $message" 1>&2 + elif [ -n "$DEBUG" ] && [ "$level" = debug ]; then + echo "$(date "+%H:%M:%N") $message" 1>&2 fi }