Log version on startup #86

Closed
opened 2026-07-09 21:42:21 +01:00 by danny · 1 comment
Owner

When testing it's not always clear which version is running. We already log a startup banner - we should report the binary version there too,

When testing it's not always clear which version is running. We already log a startup banner - we should report the binary version there too,
Collaborator

Plan

There's no literal "startup banner" today - the closest thing is getExecutableDir's absExeDir = '...' info line, logged early in NFQForwarderMain via prePendPath. This ticket adds an
explicit version line right after logging is initialized (setupLogging), at Info level so
it's visible by default, not gated behind --debug.

The version string is already stamped at build time into cmd/main.go's version var (issue
#23), threaded into cmd/setup.NewApp for --version - but never reaches
internal/nfq_forwarder.NFQForwarderMain today. Fix: add a version string parameter to
NFQForwarderMain, passed through from setup.go's existing closure over version, and log
nfq_forwarder %s starting as the first line after setupLogging(appConfig) runs (so it goes
through the real tint/syslog-prefix handler, not whatever slog's zero-value default is before
that point).

NFQForwarderMain isn't called from any test today (per CLAUDE.md's Testing section - it needs
root/real iptables/netlink), so this is a low-risk signature change with no existing test to
update, beyond the one real call site in cmd/setup/setup.go.

Branch: issue86_log_version.

## Plan There's no literal "startup banner" today - the closest thing is `getExecutableDir`'s `absExeDir = '...'` info line, logged early in `NFQForwarderMain` via `prePendPath`. This ticket adds an explicit version line right after logging is initialized (`setupLogging`), at `Info` level so it's visible by default, not gated behind `--debug`. The version string is already stamped at build time into `cmd/main.go`'s `version` var (issue #23), threaded into `cmd/setup.NewApp` for `--version` - but never reaches `internal/nfq_forwarder.NFQForwarderMain` today. Fix: add a `version string` parameter to `NFQForwarderMain`, passed through from `setup.go`'s existing closure over `version`, and log `nfq_forwarder %s starting` as the first line after `setupLogging(appConfig)` runs (so it goes through the real tint/syslog-prefix handler, not whatever slog's zero-value default is before that point). `NFQForwarderMain` isn't called from any test today (per CLAUDE.md's Testing section - it needs root/real iptables/netlink), so this is a low-risk signature change with no existing test to update, beyond the one real call site in `cmd/setup/setup.go`. Branch: `issue86_log_version`.
claude referenced this issue from a commit 2026-07-09 21:55:06 +01:00
danny closed this issue 2026-07-09 22:09:04 +01:00
Sign in to join this conversation.
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#86
No description provided.