Read misc.loglevel from RFC 5424 and POSIX <syslog.h> #28

Merged
lilleman merged 10 commits from misc-loglevel into main 2026-09-20 21:32:03 +02:00
3 changed files with 4 additions and 6 deletions
Showing only changes of commit 839b7bd164 - Show all commits
+2 -2
View File
@@ -192,7 +192,7 @@ for an ASCII one, which selects the row too, so `misc.tld[.рф]` renders `.xn--
draw spans the whole zone, `.arpa` and `.zuerich` alike, so pin `misc.tld[.com]` where draw spans the whole zone, `.arpa` and `.zuerich` alike, so pin `misc.tld[.com]` where
a fixture needs one a reader recognises. a fixture needs one a reader recognises.
`misc.loglevel` is RFC 5424's eight severities, keyed by the numerical code a syslog `misc.loglevel` is RFC 5424's eight severities, keyed by the numerical code a syslog
PRI carries and named by the severity, so `misc.loglevel[3]` and `misc.loglevel[Error]` PRI encodes and named by the severity, so `misc.loglevel[3]` and `misc.loglevel[Error]`
are one row and `misc.loglevel.code` the number beside the name. are one row and `misc.loglevel.code` the number beside the name.
[`DATA-LICENSES.md`](DATA-LICENSES.md) names each table's source and licence. [`DATA-LICENSES.md`](DATA-LICENSES.md) names each table's source and licence.
@@ -1234,7 +1234,7 @@ the Development section below, and who ships a register the four above then draw
stands alone, which is `EH` alone, and naming one for it would be a claim stands alone, which is `EH` alone, and naming one for it would be a claim
fejkdata has no business making. fejkdata has no business making.
- **`misc.loglevel` is a table keyed by the code, not a list of names.** A syslog - **`misc.loglevel` is a table keyed by the code, not a list of names.** A syslog
message carries the severity as the number inside its PRI, so the code and the name message carries the severity as the number its PRI encodes, so the code and the name
are one fact and goal 1 draws them together. The `emerg`, `err` and `info` an are one fact and goal 1 draws them together. The `emerg`, `err` and `info` an
rsyslog config takes are BSD's spellings, which RFC 5424 writes nowhere, so shipping rsyslog config takes are BSD's spellings, which RFC 5424 writes nowhere, so shipping
them would be the hand-written mapping goal 10 keeps out of a sourced table. them would be the hand-written mapping goal 10 keeps out of a sourced table.
+1 -3
View File
@@ -3,9 +3,7 @@
data-import/loglevel.py [--source URL_OR_FILE] [--cache DIR] [--out FILE] data-import/loglevel.py [--source URL_OR_FILE] [--cache DIR] [--out FILE]
Table 2 is the whole set, read between the facility table's caption and its own. The Table 2 is the whole set, read between the facility table's caption and its own.
RFC describes both tables for informational purposes, so a severity is what an
originator writes rather than something a collector rejects.
""" """
import argparse import argparse
import re import re
+1 -1
View File
@@ -733,7 +733,7 @@ func TestShippedTables(t *testing.T) {
"loglevel[5]": "Notice", "loglevel[5]": "Notice",
"loglevel[6]": "Informational", "loglevel[6]": "Informational",
"loglevel[7]": "Debug", "loglevel[7]": "Debug",
"loglevel[Informational].code": "6", "loglevel[Error].code": "3",
} { } {
if got := fake(t, f, path); got != want { if got := fake(t, f, path); got != want {
t.Errorf("Fake(%q) = %q, want %q", path, got, want) t.Errorf("Fake(%q) = %q, want %q", path, got, want)