add function to change loglevel
This commit is contained in:
parent
866a059ad1
commit
543484d51c
1 changed files with 11 additions and 0 deletions
11
functions.sh
11
functions.sh
|
@ -793,3 +793,14 @@ ssh-runinagent () {
|
|||
fi
|
||||
}
|
||||
|
||||
changeloglevel () {
|
||||
local loglevels
|
||||
declare -a loglevels
|
||||
loglevels=("ERROR" "WARN" "INFO" "DEBUG" "TRACE")
|
||||
if [[ ${loglevels[*]} =~ $1 ]]; then
|
||||
export LOGLEVEL=$1
|
||||
else
|
||||
logerror "LOGLEVEL must be one of ERROR, WARN, INFO, DEBUG or TRACE"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue