Skip to content

eventlog: add ATTENTION log level#55

Merged
andoma merged 1 commit into
masterfrom
mla/attention-to-details
Jun 10, 2026
Merged

eventlog: add ATTENTION log level#55
andoma merged 1 commit into
masterfrom
mla/attention-to-details

Conversation

@mla2

@mla2 mla2 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Adds a 9th level, LOG_ATTENTION (severity between ERR and INFO).

The level previously lived in a 3-bit field in both the on-flash log byte and the network wire byte (bit 6 = discontinuity), with all 8 syslog slots used. A 9th level needs a 4th bit, so the format byte is relaid out to DTTT_LLLL (level bits 0-3, ts-len bits 4-6, discontinuity bit 7). This is a wire-format break on the "log" service: old and new firmware/host will not interop until both are updated.

ATTENTION is appended as value 8 rather than inserted, so the existing 0-7 numbering stays aligned with POSIX <syslog.h> values used by the host decoders and with already-stored flash logs. Nothing orders levels numerically, so the severity-between-ERR-and-INFO meaning is purely documentation. The alert service is unaffected (it carries the level in a full byte).

Decouple alert severity from the event-log (syslog) levels. alert.h now
defines alert_level_t {NOTICE, WARNING, ATTENTION, ERROR}, ordered by
ascending severity with ATTENTION sitting between WARNING and ERROR.

ac_level and alert_level_to_string are retyped to alert_level_t. The
climate_zone and power_rail sources map their states onto the new scale
(error/critical -> ERROR, otherwise WARNING). When an alert is written
into the system log, alert_set maps the alert level to an event level
(ATTENTION has no distinct event-log slot, so it logs as WARNING).

The eventlog levels and the log wire/flash format are unchanged. The
alert service already carries the level in a full byte, so the alert
wire format is unaffected.
@mla2 mla2 force-pushed the mla/attention-to-details branch from ba7c7e3 to 3147c98 Compare June 9, 2026 10:56
@mla2 mla2 marked this pull request as ready for review June 9, 2026 16:49
@andoma andoma merged commit 05f517d into master Jun 10, 2026
1 check passed
@andoma andoma deleted the mla/attention-to-details branch June 10, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants