Skip to content

fix(lib): send error and warning logs to stderr - #49

Merged
sha1n merged 2 commits into
masterfrom
fix/log-streams
Oct 1, 2026
Merged

sha1n merged 2 commits into
masterfrom
fix/log-streams

Conversation

@sha1n

@sha1n sha1n commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Error and warning logs now go to stderr from the shared logger, not from a redirect at each call site. A helper that returns a value through $(...) can no longer swallow its own errors, which happened twice before.

Changes

  • Add a test that requires error and warn on stderr and the other log functions on stdout.
  • Move error and warn to stderr, remove the 32 call-site redirects, and record the rule in AGENTS.md.

Review notes

  • Visible change: with only stdout redirected (install.sh > log.txt), errors and warnings now go to the terminal; use 2>&1.
  • Local runs can fail on a stale scripts/lib.zsh.zwc: tests/profile_update_orphans.test.sh copies it; run make compile first.

🤖 Generated with Claude Code

sha1n and others added 2 commits October 1, 2026 10:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
__profile_log_error and __profile_log_warn now write to stderr, so a
helper that returns a value through $(...) cannot swallow its errors,
and no call site has to remember a redirect. The per-call-site >&2 in
scripts/profile and include/functions are removed. info, success and
section stay on stdout.

Errors and warnings from install.sh, update_dotfiles.sh, the github
email privacy scripts and the start, jest, wt and wt_rm functions move
from stdout to stderr. On a terminal nothing changes. When only stdout
is redirected (install.sh > log.txt), these lines now go to the
terminal and not to the file; use 2>&1 to capture both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sha1n sha1n added the bug Something isn't working label Oct 1, 2026
@sha1n sha1n self-assigned this Oct 1, 2026
@sha1n
sha1n merged commit b17ad9c into master Oct 1, 2026
2 checks passed
@sha1n
sha1n deleted the fix/log-streams branch October 1, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant