changed message to local val msg

This commit is contained in:
Gerhard Hoffmann 2022-06-05 12:33:50 +02:00
parent 05a9822361
commit 19721380b5

View File

@ -25,13 +25,14 @@ log() {
if [ -f "$log_file" ]; then
touch $log_file
fi
if [ $(wc -l < $log_file) > 100000 ]; then
if [[ "$(wc -l < $log_file)" > "100000" ]]; then
# remove first line
sed -e 1d -i $log_file
fi
message="$(date +'%D_%T'): $*"
printf "$message\n" >&2
printf "$message\n" >> $log_file
local msg="$(date +'%Y-%m-%d_%T'): $*"
printf "$msg\n" >&2
printf "$msg\n" >> $log_file
}
log_debug() {