From c80d8a5ff8d03cb7b7343a5c827d9b92c8dca6e0 Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Tue, 26 Jan 2021 15:52:02 +0100 Subject: [PATCH] Facility+Severity to PRI value. --- src/main/java/biz/nellemann/syslogd/SyslogPrinter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/biz/nellemann/syslogd/SyslogPrinter.java b/src/main/java/biz/nellemann/syslogd/SyslogPrinter.java index eb6aa48..2396b58 100644 --- a/src/main/java/biz/nellemann/syslogd/SyslogPrinter.java +++ b/src/main/java/biz/nellemann/syslogd/SyslogPrinter.java @@ -64,11 +64,9 @@ public class SyslogPrinter { return sb.toString(); } - - // TODO: Facility+Severity to PRI field static private String getPri(Facility facility, Severity severity) { - return "<13>"; + int prival = (facility.toNumber() * 8) + severity.toNumber(); + return String.format("<%d>", prival); } - }