fi
local funcname="${FUNCNAME[1]}"
- if isset funcname; then
- message_log="${funcname}: ${message_log}"
- fi
+ message_log="${funcname}: ${message_log}"
# Set a prefix if we are in a hook.
if [ -n "${HOOK}" ]; then
message_log="${HOOK}: ${message_log}"
fi
- logger -t "${LOG_FACILITY}[$$]" "${message_log}"
+ logger -t "${LOG_FACILITY}[$$]" "${message_log}" &
# Leave here, when there should be no output on the console.
[ "${LOG_DISABLE_STDOUT}" = "true" ] && return 0
colour="${CLR_CYAN_R}"
;;
INFO)
- colour="${CLR_BLACK_R}"
console="1"
;;
WARNING)
colour="${CLR_YELLOW_R}"
;;
- ERROR)
+ CRITICAL|ERROR)
colour="${CLR_RED_B}"
;;
esac
case "${console}" in
1)
- printf "${colour}${message}${CLR_RESET_ALL}\n"
+ printf "${colour}${message}${CLR_RESET}\n"
;;
2)
- printf "${colour}${message}${CLR_RESET_ALL}\n" >&2
+ printf "${colour}${message}${CLR_RESET}\n" >&2
;;
esac
}