4 ms·
Bitwise operations: PRI = (facility << 3) | level In term of readability, it becomes clear if you use octal and not decimal representation: the last digit is s
by benou 7y ago
Bitwise operations: PRI = (facility << 3) | level
In term of readability, it becomes clear if you use octal and not decimal representation: the last digit is security level whereas the others are facility number.
- Someone 7y agogrepthisab’s comment is about the textual representation, which uses a decimal number < 192. A bit to my surprise, the textual representation also uses that for the ‘on the wire’ protocol (and that isn’t to keep the format a text format. The ‘MSG’ part of a syslog message can (but SHOULD NOT) contain arbitrary byte sequences (https://tools.ietf.org/html/rfc5424#section-6.4 https://tools.ietf.org/html/rfc5424#section-6.4). I would have expected this to be packed in a single byte there. So, we have potentially binary messages, _and_ a syslog parser must know quite a bit of Unicode. Fun :-)