Double mailbox in warn/error log output ([INBOX] ... mailbox=INBOX) #25

Closed
opened 2026-05-12 09:34:41 +02:00 by heiko · 1 comment
Owner

Found during review of #24.

In cmd/xr-invoiced/handler.go the text and journal handlers prefix warn/error messages with [mailbox], then the unconditional attr-append loop also writes mailbox=<name> from h.attrs. Resulting line:

[INBOX] process uid uid=42 mailbox=INBOX error=...

Tests assert the prefix is present but don't notice the redundant trailing attr.

Options:

  • Filter mailbox out of the attr-append loop in both textHandler and journalHandler (it's already rendered as the prefix).
  • Or drop the prefix and rely on the attr.

Pick one and update the tests to assert the chosen form.

Refs: PR #24

Found during review of #24. In `cmd/xr-invoiced/handler.go` the text and journal handlers prefix warn/error messages with `[mailbox]`, then the unconditional attr-append loop also writes `mailbox=<name>` from `h.attrs`. Resulting line: ``` [INBOX] process uid uid=42 mailbox=INBOX error=... ``` Tests assert the prefix is present but don't notice the redundant trailing attr. Options: - Filter `mailbox` out of the attr-append loop in both `textHandler` and `journalHandler` (it's already rendered as the prefix). - Or drop the prefix and rely on the attr. Pick one and update the tests to assert the chosen form. Refs: PR #24
heiko closed this issue 2026-05-12 09:37:59 +02:00
Author
Owner

Related commit: 3769de0. This issue is already closed in the tracker.

Related commit: 3769de0. This issue is already closed in the tracker.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IUS/xr-invoiced#25
No description provided.