3 # LOGLEVEL 1: Crash condition
4 # LOGLEVEL 2: Unexpected condition
5 # LOGLEVEL 3: Failed action (i.e. due to config error)
8 [ -n "$include_logging" ] && return 0
11 LOGLEVEL="${LOGLEVEL:-3}"
12 LOGFILE="${LOGFILE:-/dev/stderr}"
17 if [ "$ll" -le "$LOGLEVEL" -a "$#" -gt 0 ]; then
18 printf %s\\n "$*" >>"${LOGFILE}"
19 elif [ "$ll" -le "$LOGLEVEL" ]; then
21 elif [ ! "$#" -gt 0 ]; then
27 [ "$#" -gt 0 ] && logmsg 1 "$@"
30 panic(){ logmsg 2 "$@"; }
31 error(){ logmsg 3 "$@"; }
32 debug(){ logmsg 4 "$@"; }