From f53340fa52437b7a4dbe06834f0cdf1233678c72 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 29 Feb 2024 19:44:00 +0200 Subject: Added debug output --- bin/ak-logthis | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bin') diff --git a/bin/ak-logthis b/bin/ak-logthis index 024f9d2..295f60d 100755 --- a/bin/ak-logthis +++ b/bin/ak-logthis @@ -7,17 +7,33 @@ then if [ ! -z "$3" ] then echo "$TS" "$1" "$2" "$3" >> $AK_LOGSFILE + if [ "$AK_DEBUG" == "yes" ] + then + echo "$TS" "$1" "$2" "$3" >&2 + fi exit 0 else echo "$TS" "$1" "[ERROR]" "No message" >> $AK_LOGSFILE + if [ "$AK_DEBUG" == "yes" ] + then + echo "$TS" "$1" "[ERROR]" "No message" >&2 + fi exit 1 fi else echo "$TS" "$1" "[ERROR]" "No type and message" >> $AK_LOGSFILE + if [ "$AK_DEBUG" == "yes" ] + then + echo "$TS" "$1" "[ERROR]" "No type and message" >&2 + fi exit 1 fi else echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >> $AK_LOGSFILE + if [ "$AK_DEBUG" == "yes" ] + then + echo "$TS" "<$(basename $0)>" "[ERROR]" "No arguments given" >&2 + fi exit 1 fi -- cgit v1.2.3