Appropriately converts logger numeric level to syslog log level

The kdump-logger will be used by the system service(daemons), so let's
appropriately convert the logger numeric level to syslog level with the
facility(daemon). The number is constructed by multiplying the facility
by 8 and then adding the level.

About The Syslog Protocol, please refer to the RFC5424 for more details.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
Lianbo Jiang 2020-11-12 23:55:39 +08:00 committed by Kairui Song
parent 5b2b7ec08b
commit 239d64f6da
1 changed files with 4 additions and 1 deletions

View File

@ -172,7 +172,10 @@ _dlvl2syslvl() {
*) return 1;;
esac
[ -s /proc/vmcore ] && echo $((24+$lvl)) || echo $((8+$lvl))
# The number is constructed by multiplying the facility by 8 and then
# adding the level.
# About The Syslog Protocol, please refer to the RFC5424 for more details.
echo $((24+$lvl))
}
## @brief Prints to stderr, to syslog and/or /dev/kmsg given message with