Repository navigation
fix(lib): send error and warning logs to stderr - #49
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
errorandwarnon stderr and the other log functions on stdout.errorandwarnto stderr, remove the 32 call-site redirects, and record the rule in AGENTS.md.Review notes
install.sh > log.txt), errors and warnings now go to the terminal; use2>&1.scripts/lib.zsh.zwc:tests/profile_update_orphans.test.shcopies it; runmake compilefirst.🤖 Generated with Claude Code