Skip to content

Print warnings to stderr instead of stdout#1202

Merged
ericmj merged 1 commit into
mainfrom
jm/stderr
Jul 18, 2026
Merged

Print warnings to stderr instead of stdout#1202
ericmj merged 1 commit into
mainfrom
jm/stderr

Conversation

@maennchen

Copy link
Copy Markdown
Member

Hex.Shell.warn/1 wrote to stdout via Mix.shell().info/1, so warnings like the expired-authentication notice or the stale mix.lock version warning polluted machine-readable stdout output such as mix hex.outdated --json. Route warn/1 through Mix.shell().error/1, which prints to stderr, keeping the yellow warning color.

Warning-colored lines that are part of a command's regular stdout output (the retirement reason in the mix deps.get dependency listing and the retirement notice in mix hex.info) stay on stdout and are now printed as yellow-formatted info lines instead.

Hex.Shell.warn/1 wrote to stdout via Mix.shell().info/1, so warnings
like the expired-authentication notice or the stale mix.lock version
warning polluted machine-readable stdout output such as
`mix hex.outdated --json`. Route warn/1 through Mix.shell().error/1,
which prints to stderr, keeping the yellow warning color.

Warning-colored lines that are part of a command's regular stdout
output (the retirement reason in the `mix deps.get` dependency
listing and the retirement notice in `mix hex.info`) stay on stdout
and are now printed as yellow-formatted info lines instead.
@ericmj
ericmj merged commit 29b5731 into main Jul 18, 2026
22 checks passed
@ericmj
ericmj deleted the jm/stderr branch July 18, 2026 20:00
@ericmj

ericmj commented Jul 18, 2026

Copy link
Copy Markdown
Member

Thank you! 💜

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.

2 participants