Log version on startup #87

Merged
danny merged 1 commit from issue86_log_version into main 2026-07-09 22:09:04 +01:00
Collaborator

Closes #86.

There's no literal "startup banner" today - added an explicit nfq_forwarder %s starting line at Info level, right after setupLogging(appConfig) runs (so it goes through the real tint/syslog-prefix handler, not slog's zero-value default before that point). NFQForwarderMain gained a version string parameter, threaded from cmd/setup/setup.go's existing closure over the same version string --version already prints (issue #23).

NFQForwarderMain is never called from a test (needs root/real iptables/netlink), so no existing test needed updating. Manually verified against a real built binary - confirmed the version line is the very first thing printed, correctly carrying issue #37's <6> syslog-priority prefix too:

<6>Jul  9 21:54:12.225 INF nfq_forwarder dev starting

--version itself is unaffected (confirmed unchanged output).

make lint/make test clean.

Closes #86. There's no literal "startup banner" today - added an explicit `nfq_forwarder %s starting` line at Info level, right after `setupLogging(appConfig)` runs (so it goes through the real tint/syslog-prefix handler, not slog's zero-value default before that point). `NFQForwarderMain` gained a `version string` parameter, threaded from `cmd/setup/setup.go`'s existing closure over the same version string `--version` already prints (issue #23). `NFQForwarderMain` is never called from a test (needs root/real iptables/netlink), so no existing test needed updating. Manually verified against a real built binary - confirmed the version line is the very first thing printed, correctly carrying issue #37's `<6>` syslog-priority prefix too: ``` <6>Jul 9 21:54:12.225 INF nfq_forwarder dev starting ``` `--version` itself is unaffected (confirmed unchanged output). `make lint`/`make test` clean.
Log version on startup
All checks were successful
CI / lint (push) Successful in 26s
CI / build (push) Successful in 27s
CI / lint (pull_request) Successful in 26s
CI / build (pull_request) Successful in 27s
CI / release (push) Has been skipped
CI / release (pull_request) Has been skipped
e45ae9b017
nfq_forwarder's build version was only ever visible via a separate
--version invocation. Thread it into NFQForwarderMain and log it as
the first line once real logging is initialized, so it's visible by
default (e.g. in journalctl) without needing to check separately.

Closes #86

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
claude requested review from danny 2026-07-09 21:55:30 +01:00
danny scheduled this pull request to auto merge when all checks succeed 2026-07-09 22:08:26 +01:00
danny approved these changes 2026-07-09 22:09:02 +01:00
danny left a comment

LGTM

LGTM
danny merged commit 350e8d39a3 into main 2026-07-09 22:09:04 +01:00
danny deleted branch issue86_log_version 2026-07-09 22:09:04 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
keyop-go/nfq_forwarder!87
No description provided.