Skip to content

Consistent output — replace bare print macros with output system#23

Merged
maxholman merged 5 commits into
block65:mainfrom
maxholman:refactor/consistent-output
Feb 20, 2026
Merged

Consistent output — replace bare print macros with output system#23
maxholman merged 5 commits into
block65:mainfrom
maxholman:refactor/consistent-output

Conversation

@maxholman

Copy link
Copy Markdown
Contributor

Consistent output — replace bare print macros with output system

Scope

crates/cli/src/ — exit.rs, entry.rs, relay.rs

Out of scope

build.rs, version.rs, cli.rs, subscriber.rs, output.rs — these are all legitimate
uses of print macros and must not be changed.

Why

Some status and warning messages bypass the output system (the info!, warn!,
error! macros and the Printer type in session.rs) and write directly via
bare println! or eprintln!. This causes inconsistent formatting, incorrect
stream routing, and messages that ignore output configuration (colour, format).

The most visible symptom is the auth warning — "WARNING: Connecting without
authentication..." — which has its own ad-hoc format instead of going through
warn!.

Notes

  • The output macros (info!, warn!, error!, verbose!) are in output.rs
    and write to stderr via the global OUTPUT_CONFIG
  • The Printer in session.rs is for REPL/connection handler output and writes
    to stdout with styling
  • The goal is consistent formatting and correct stream routing — not necessarily
    a one-to-one replacement of every call site

maxholman and others added 5 commits February 20, 2026 21:21
Bare println!/eprintln! calls in exit.rs, entry.rs, and relay.rs
bypassed the output system, causing inconsistent formatting, incorrect
stream routing, and messages that ignored colour and format config.

Replace all ad-hoc print calls with crate::info!, crate::warn!, and
crate::error!. Auth warnings (the most visible case) are now routed
through crate::warn! with consistent formatting. Connection retry
messages go through crate::info!. Non-retryable failures use
anyhow context so they surface once through the error chain rather
than being printed separately and then re-displayed by main.

The redundant println! in relay.rs that duplicated an existing
crate::info! call is removed. REPL printer fallbacks (println! in
the rustyline output thread) are unchanged — they are part of the
Printer mechanism, not ad-hoc status output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The .dockerignore was missing a target/ exclusion rule, causing the
entire 30 GB target directory to be sent as build context on every
docker compose build. The exception path was also stale — pointing at
the pre-CARGO_TARGET_DIR path instead of target/musl/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Commits scoped to internal modules (e.g. feat(server):, feat(tls):)
only touch crates/wallhack and were silently excluded from the cli
changelog. Since all user-facing changes flow through wallhack before
reaching the cli binary, tracking it ensures no feat or fix is missed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Zero-config is a first-class feature. The per-connection auth warning
on exit and relay nodes was noise — removed entirely. The --insecure
flag existed only to suppress that warning so it is removed too.

The entry node retains a single startup warning when no PSK is
configured, which is the right place for it (once, at listen time,
not on every incoming connection).

Introduce route_info! and route_warn! macros in output.rs to route
status messages through the Printer when in interactive/REPL mode,
or the output system (stderr) when headless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- gitignore: add AI agent instruction files (CLAUDE.md, GEMINI.md,
  copilot-instructions.md) and AI-generated docs patterns so they
  stay local without showing as untracked
- TODO: remove completed zero-config auth warning item (done by
  previous commit), remove stale ANALYSIS.md reference

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@maxholman
maxholman merged commit 3b05637 into block65:main Feb 20, 2026
4 checks passed
maxholman added a commit that referenced this pull request Mar 15, 2026
- #23: debug-level TCP relay connect/close logs with byte counts on exit node
- #25: PskFailTracker deduplicates PSK failure logs per source IP (x1, x2, x4…)
- #27: log "PSK authentication configured" on startup when PSK is set
- #17: startup banner shows CLI binary version + build timestamp/git hash + dirty flag
- Remove double-warn on PSK failure (validate_handshake + caller)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant