change from changeloglevel to setloglevel

This commit is contained in:
Jakobus Schürz 2020-09-21 21:59:44 +02:00
parent 543484d51c
commit 6b3304a8bc

View file

@ -793,14 +793,15 @@ ssh-runinagent () {
fi
}
changeloglevel () {
setloglevel () {
local loglevels
declare -a loglevels
loglevels=("ERROR" "WARN" "INFO" "DEBUG" "TRACE")
if [[ ${loglevels[*]} =~ $1 ]]; then
if [[ ${loglevels[*]} =~ "$1" ]]; then
export LOGLEVEL=$1
else
logerror "LOGLEVEL must be one of ERROR, WARN, INFO, DEBUG or TRACE"
fi
logerror "new LOGLEVEL is $LOGLEVEL"
}