]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-logger.sh: systemd-cat only understands prio 0-7
authorHarald Hoyer <harald@redhat.com>
Wed, 22 Jan 2014 10:48:45 +0000 (11:48 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 22 Jan 2014 10:48:45 +0000 (11:48 +0100)
dracut-logger.sh

index f679dc945164fe7b8b65daafcb1956c332648209..70b0da4c624def2e6770c97b80391337bc7ec1e5 100755 (executable)
@@ -154,7 +154,7 @@ dlog_init() {
             readonly _systemdcatfile="$_dlogdir/systemd-cat"
             mkfifo "$_systemdcatfile"
             readonly _dlogfd=15
-            systemd-cat -t 'dracut' <"$_systemdcatfile" &
+            systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
             exec 15>"$_systemdcatfile"
         elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
             # We cannot log to syslog, so turn this facility off.
@@ -330,7 +330,7 @@ _do_dlog() {
 
     if (( $lvl <= $sysloglvl )); then
         if [[ "$_dlogfd" ]]; then
-            echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
+            printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
         else
             logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
         fi