]> git.ipfire.org Git - people/ms/network.git/blobdiff - functions.logging
hostapd: Enable WMM by default.
[people/ms/network.git] / functions.logging
index ce0a95648fc71ea8282ac16109f13a481d7138be..57b432617220dfec9987b2602eaf512cdf1dbede 100644 (file)
@@ -40,16 +40,14 @@ function log() {
        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
@@ -61,23 +59,22 @@ function log() {
                        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
 }