1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-12 19:03:42 +01:00

Added loglevel to log filesé

This commit is contained in:
deajan 2016-03-03 16:26:52 +01:00
parent 192e1d2f65
commit b27ee4f8c1
3 changed files with 12 additions and 12 deletions

View File

@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
PROGRAM_BUILD=2016030301
IS_STABLE=no
## FUNC_BUILD=2016021803
## FUNC_BUILD=2016030301
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
@ -107,15 +107,15 @@ function Logger {
# </OSYNC SPECIFIC>
if [ "$level" == "CRITICAL" ]; then
_Logger "$prefix\e[41m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[41m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "ERROR" ]; then
_Logger "$prefix\e[91m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[91m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "WARN" ]; then
_Logger "$prefix\e[93m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[93m$level:$value\e[0m" "$prefix$value"
WARN_ALERT=1
return
elif [ "$level" == "NOTICE" ]; then

View File

@ -1,4 +1,4 @@
## FUNC_BUILD=2016021803
## FUNC_BUILD=2016030301
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
@ -97,15 +97,15 @@ function Logger {
# </OSYNC SPECIFIC>
if [ "$level" == "CRITICAL" ]; then
_Logger "$prefix\e[41m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[41m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "ERROR" ]; then
_Logger "$prefix\e[91m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[91m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "WARN" ]; then
_Logger "$prefix\e[93m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[93m$level:$value\e[0m" "$prefix$value"
WARN_ALERT=1
return
elif [ "$level" == "NOTICE" ]; then

View File

@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
PROGRAM_BUILD=2016030301
IS_STABLE=no
## FUNC_BUILD=2016021803
## FUNC_BUILD=2016030301
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
@ -102,15 +102,15 @@ function Logger {
# </OSYNC SPECIFIC>
if [ "$level" == "CRITICAL" ]; then
_Logger "$prefix\e[41m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[41m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "ERROR" ]; then
_Logger "$prefix\e[91m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[91m$level:$value\e[0m" "$prefix$value"
ERROR_ALERT=1
return
elif [ "$level" == "WARN" ]; then
_Logger "$prefix\e[93m$value\e[0m" "$prefix$value"
_Logger "$prefix\e[93m$level:$value\e[0m" "$prefix$value"
WARN_ALERT=1
return
elif [ "$level" == "NOTICE" ]; then