Set log_level to INFO

This commit is contained in:
Gerhard Hoffmann 2022-07-08 13:50:16 +02:00
parent 27cd99f96a
commit b8bc61daea

View File

@ -21,7 +21,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
readonly FATAL=5 readonly FATAL=5
readonly MAX_DEBUG_LEVEL=6 readonly MAX_DEBUG_LEVEL=6
log_level=0 log_level=$INFO
set_dbg_level () { set_dbg_level () {
if [ $1 < $MAX_DEBUG_LEVEL ]; then if [ $1 < $MAX_DEBUG_LEVEL ]; then
@ -34,6 +34,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
} }
log() { log() {
# TODO: kann man wohl entfernen
if [[ $(("$(wc -l < $log_file)")) -ge $((100000)) ]]; then if [[ $(("$(wc -l < $log_file)")) -ge $((100000)) ]]; then
# remove first line # remove first line
sed -e 1d -i $log_file sed -e 1d -i $log_file
@ -44,7 +45,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
} }
log_debug() { log_debug() {
if [ $log_level = $DEBUG ]; then if [ $log_level -le $DEBUG ]; then
log "DEBUG $*" log "DEBUG $*"
fi fi
} }