diff options
author | Jim Pryor <profjim@jimpryor.net> | 2009-09-14 05:43:46 +0200 |
---|---|---|
committer | James Rayner <james@archlinux.org> | 2009-09-14 08:27:02 +0200 |
commit | b2badb11c7f3f71c80bd768fb62b0ef0b0718254 (patch) | |
tree | 16358716c082808565ce9d2bcf9563042233871c /contrib/logging.hook | |
parent | 2c5d0f94f08527151267482f67f1c4964f0a75e1 (diff) | |
download | netctl-b2badb11c7f3f71c80bd768fb62b0ef0b0718254.tar.gz netctl-b2badb11c7f3f71c80bd768fb62b0ef0b0718254.tar.xz |
added more contrib/ files
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'contrib/logging.hook')
-rwxr-xr-x | contrib/logging.hook | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/contrib/logging.hook b/contrib/logging.hook index 163bbfa..b7af62e 100755 --- a/contrib/logging.hook +++ b/contrib/logging.hook @@ -14,17 +14,17 @@ NETCFG_LOG="${NETCFG_LOG-local0}" function report_log { - if [[ -n "$NETCFG_LOG" ]]; then - local caller level="$1" - shift - case "$0" in - net-auto|netcfg-auto-*) caller=net-auto;; - net-profiles) caller=net-profiles;; - net-rename) caller=net-rename;; - *) caller=netcfg;; - esac - logger -p "${NETCFG_LOG}.$level" -t "$caller" -- "$*" - fi + if [[ -n "$NETCFG_LOG" ]]; then + local caller level="$1" + shift + case "$0" in + net-auto|netcfg-auto-*) caller=net-auto;; + net-profiles) caller=net-profiles;; + net-rename) caller=net-rename;; + *) caller=netcfg;; + esac + logger -p "${NETCFG_LOG}.$level" -t "$caller" -- "$*" + fi } @@ -36,23 +36,23 @@ function report_err { function report_warn { report_log warning "$*" # printhl "$*" - checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2 + checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2 } function report_notify { - report_log notice "$*" - # print "$*" >&2 - checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2 + report_log notice "$*" + # print "$*" >&2 + checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2 } function report_debug { - if checkyesno "$NETCFG_DEBUG"; then - echo "DEBUG: $*" >&2 - else - report_log debug "$*" - fi + if checkyesno "$NETCFG_DEBUG"; then + echo "DEBUG: $*" >&2 + else + report_log debug "$*" + fi } @@ -82,9 +82,10 @@ function report_fail { function report_success { if [[ -n "$*" ]]; then stat_append "- $*" - REPORT_TRYING= + REPORT_TRYING= fi report_log notice "${*:-succeeded}" stat_done } +# vim: ft=sh ts=4 et sw=4: |