convert to upper case, add function
This commit is contained in:
parent
03d0bda623
commit
58bcb86901
1 changed files with 13 additions and 2 deletions
15
functions.sh
15
functions.sh
|
@ -807,8 +807,8 @@ setloglevel () {
|
||||||
local oldloglevel=${LOGLEVEL-$LOGLEVEL_DEFAULT}
|
local oldloglevel=${LOGLEVEL-$LOGLEVEL_DEFAULT}
|
||||||
declare -a loglevels
|
declare -a loglevels
|
||||||
loglevels=("ERROR" "WARN" "INFO" "DEBUG" "TRACE")
|
loglevels=("ERROR" "WARN" "INFO" "DEBUG" "TRACE")
|
||||||
if [[ ${loglevels[*]} =~ "$1" ]]; then
|
if [[ ${loglevels[*]} =~ "${1^^}" ]]; then
|
||||||
export LOGLEVEL=$1
|
export LOGLEVEL=${1^^}
|
||||||
else
|
else
|
||||||
logerror "LOGLEVEL must be one of ERROR, WARN, INFO, DEBUG or TRACE"
|
logerror "LOGLEVEL must be one of ERROR, WARN, INFO, DEBUG or TRACE"
|
||||||
fi
|
fi
|
||||||
|
@ -831,4 +831,15 @@ setfileloglevel () {
|
||||||
EXIT
|
EXIT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getloglevels () {
|
||||||
|
ENTRY
|
||||||
|
cat << EOF
|
||||||
|
LOGLEVEL: ${LOGLEVEL-${LOGLEVEL_DEFAULT}}
|
||||||
|
FILELOGLEVEL: ${FILELOGLEVEL-${FILELOGLEVEL_DEFAULT}}
|
||||||
|
|
||||||
|
change LOGLEVEL: \$ setloglevel [ERROR|WARN|INFO|DEBUG|TRACE]
|
||||||
|
change FILELOGLEVEL: \$ setfileloglevel [ERROR|WARN|INFO|DEBUG|TRACE]
|
||||||
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
#EOF
|
#EOF
|
||||||
|
|
Loading…
Reference in a new issue