From: Harald Hoyer Date: Thu, 22 Sep 2011 13:49:25 +0000 (+0200) Subject: dracut-logger: bail out early, if we don't have to log anything X-Git-Tag: 014~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69063507d4c553cb5c4e51fb401d29eda7106351;p=thirdparty%2Fdracut.git dracut-logger: bail out early, if we don't have to log anything --- diff --git a/dracut-logger b/dracut-logger index d85cbafe9..ce2820861 100755 --- a/dracut-logger +++ b/dracut-logger @@ -271,12 +271,8 @@ _dlvl2syslvl() { # - @c INFO to @c info # - @c DEBUG and @c TRACE both to @c debug _do_dlog() { - [ -z "$maxloglvl" ] && return 0 local lvl="$1"; shift local lvlc=$(_lvl2char "$lvl") || return 0 - - [ $lvl -le $maxloglvl ] || return 0 - local msg="$lvlc: $*" [ $lvl -le $stdloglvl ] && echo "$msg" >&2 @@ -307,6 +303,9 @@ _do_dlog() { # dwarn "This is a warning" # echo "This is a warning" | dwarn dlog() { + [ -z "$maxloglvl" ] && return 0 + [ $1 -le $maxloglvl ] || return 0 + if [ $# -gt 1 ]; then _do_dlog "$@" else