Use echo over printf on logging function

This commit is contained in:
Juno Takano 2024-07-18 09:13:18 -03:00
parent c8b8374175
commit 18af77ba26

View file

@ -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
}