Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Machine output redirected to stdout. #2922

Closed

Conversation

kunalkushwaha
Copy link
Contributor

log functions are used both writing output and logging errors.
As raised in bug #2920, output redirection in script creates confusion.
This fixes the issue by redirecting error to stderr and output to stdout.

Signed-off-by: Kunal Kushwaha kushwaha_kunal_v7@lab.ntt.co.jp

log functions are used both writing output and logging errors.
As raised in bug docker#2920, output redirection in script creates confusion.
This fixes the issue by redirecting error to stderr and output to stdout.

Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
@dgageot
Copy link
Member

dgageot commented Jan 26, 2016

Hi @kunalkushwaha Can you give an example of something fixed by this PR?

@jeanlaurent
Copy link
Member

In the config command, we take care of rerouting any log from stout to stderr because we protect ourselves of any logs that can messed up the output.

We do the same in the env command.

@nathanleclaire
Copy link
Contributor

Hi @kunalkushwaha, thanks for the PR.

It is deliberate that any log output should go to STDERR for config and for env. The reason for this is that those commands are meant to be executed within subshells ($(...) or backticks), and anything printed to STDOUT from them will be interpreted by the shell as a command. (STDERR will "escape" to be displayed on the terminal) So, we are intentionally being deliberate about what we send to STDOUT.

I think we should probably not merge this.

@kunalkushwaha
Copy link
Contributor Author

@dgageot @jeanlaurent @nathanleclaire I understood the reason for output redirection to stderr.

I saw bug assigned for 0.6.0 release, so tried to fix it. I admit it was not well thought solution though.
Closing the PR.

Thanks

@nathanleclaire
Copy link
Contributor

Thanks for following up to close @kunalkushwaha !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants