From 29f2ce84188188e67a9e200351591d1eee665879 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Wed, 30 Dec 2020 10:03:23 +0100 Subject: [PATCH] fix log_message, log_updates do not interpret \n\t etc --- bashbot.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index 275a067..ccc31f3 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -26,7 +26,7 @@ # 8 - curl/wget missing # 10 - not bash! # -#### $$VERSION$$ v1.21-dev-36-gc6001c2 +#### $$VERSION$$ v1.21-dev-37-g91419a2 ################################################################## # shellcheck disable=SC2140,SC2031,SC2120,SC1091,SC1117,SC2059 @@ -95,11 +95,12 @@ check_token(){ [[ "${1}" =~ ^[0-9]{8,10}:[a-zA-Z0-9_-]{35}$ ]] && return 0 return 1 } -# log $1 to ERRORLOG with date +# log $1 with date, interpret \n \t ... log_error(){ printf "%s: %b\n" "$(date)" "$*" >>"${ERRORLOG}"; } log_debug(){ printf "%s: %b\n" "$(date)" "$*" >>"${DEBUGLOG}"; } -log_message(){ printf "\n%s: %s\n" "$(date)" "$*" >>"${MESSAGELOG}"; } -log_update(){ printf "%s: %b\n" "$(date)" "$*" >>"${UPDATELOG}"; } +# log $1 with date +log_update(){ printf "%s: %s\n" "$(date)" "$*" >>"${UPDATELOG}"; } +log_message(){ printf "\n%s: %s\n" "$(date)" "$*" >>"${MESSAGELOG/\\n/$'\n'}"; } # additional tests if we run in debug mode export BASHBOTDEBUG