Skip to content

Print warnings to stderr instead of stdout#1202

Open
maennchen wants to merge 1 commit into
mainfrom
jm/stderr
Open

Print warnings to stderr instead of stdout#1202
maennchen wants to merge 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.
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