Added color to TrapError output

This commit is contained in:
deajan 2016-11-14 22:01:44 +01:00
parent 111d3569a7
commit 6bdd5b0a1a
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#### MINIMAL-FUNCTION-SET BEGIN #### #### MINIMAL-FUNCTION-SET BEGIN ####
## FUNC_BUILD=2016111402 ## FUNC_BUILD=2016111403
## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## To use in a program, define the following variables: ## To use in a program, define the following variables:
@ -141,7 +141,7 @@ function Logger {
ERROR_ALERT=true ERROR_ALERT=true
return return
elif [ "$level" == "WARN" ]; then elif [ "$level" == "WARN" ]; then
_Logger "$prefix\e[93m$value\e[0m" "$prefix$level:$value" "$level:$value" _Logger "$prefix\e[33m$value\e[0m" "$prefix$level:$value" "$level:$value"
WARN_ALERT=true WARN_ALERT=true
return return
elif [ "$level" == "NOTICE" ]; then elif [ "$level" == "NOTICE" ]; then
@ -475,7 +475,7 @@ function TrapError {
local code="${2:-1}" local code="${2:-1}"
if [ $_SILENT == false ]; then if [ $_SILENT == false ]; then
echo -e " /!\ ERROR in ${job}: Near line ${line}, exit code ${code}" echo -e "\e[45m/!\ ERROR in ${job}: Near line ${line}, exit code ${code}"
fi fi
} }