38 lines
1.0 KiB
Diff
38 lines
1.0 KiB
Diff
|
From 69063507d4c553cb5c4e51fb401d29eda7106351 Mon Sep 17 00:00:00 2001
|
||
|
From: Harald Hoyer <harald@redhat.com>
|
||
|
Date: Thu, 22 Sep 2011 15:49:25 +0200
|
||
|
Subject: [PATCH] dracut-logger: bail out early, if we don't have to log
|
||
|
anything
|
||
|
|
||
|
---
|
||
|
dracut-logger | 7 +++----
|
||
|
1 files changed, 3 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/dracut-logger b/dracut-logger
|
||
|
index d85cbaf..ce28208 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
|