Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle stderr vs stdout #75

Merged
merged 1 commit into from Jan 7, 2020
Merged

Conversation

SimonRichardson
Copy link
Member

When attempting to handle stdout vs stderr for formatting directives it
turns out that it's none-trivial and we should be really consistent with
where our stdout and stderr messages go.

With that in mind, the changes here ensure that when we encounter an
error for a machine format, the EMPTY value for each format is correctly
rendered to the STDOUT and not STDERR.

stderr is useful for error messages and until we have an appropriate way
of putting logs for CLI commands, we should use stderr for constructive
information that the consumer can use.

For scripting, stderr can always be redirected 2>/dev/null or to any
file so they can view what went wrong at a later date.

When attempting to handle stdout vs stderr for formatting directives it
turns out that it's none-trivial and we should be really consistent with
where our stdout and stderr messages go.

With that in mind, the changes here ensure that when we encounter an
error for a machine format, the EMPTY value for each format is correctly
rendered to the STDOUT and not STDERR.

stderr is useful for error messages and until we have an appropriate way
of putting logs for CLI commands, we should use stderr for constructive
information that the consumer can use.

For scripting, stderr can always be redirected 2>/dev/null or to any
file so they can view what went wrong at a later date.
Copy link

@achilleasa achilleasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SimonRichardson
Copy link
Member Author

$$merge$$

@jujubot jujubot merged commit 5cf0c29 into juju:master Jan 7, 2020
@SimonRichardson SimonRichardson deleted the std-outputs branch January 7, 2020 17:59
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.

None yet

3 participants