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

nix-prefetch-docker: output informational messages to stderr #105600

Merged
merged 1 commit into from Dec 1, 2020

Conversation

edef1c
Copy link
Member

@edef1c edef1c commented Dec 1, 2020

Motivation for this change

Informational messages belong on stderr, not on stdout and intermixed with structured output for programmatic use.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Informational messages belong on stderr, not on stdout and intermixed
with structured output for programmatic use.

Change-Id: I34d094d04460494e9ec8953db7490f4e2292d959
@SuperSandro2000
Copy link
Member

Informational messages belong on stderr

Stderr is for errors, nothing else.

@deviant
Copy link
Member

deviant commented Dec 1, 2020

Stderr is for errors, nothing else.

this is a frequent point of confusion. informational messages belong on stderr, allowing filters to act on output while messages still get printed to the terminal. this is a common UNIX idiom

from the dd manpage:

status=LEVEL
       The LEVEL of information to print to stderr; 'none'  suppresses  every‐
       thing  but  error messages, 'noxfer' suppresses the final transfer sta‐
       tistics, 'progress' shows periodic transfer statistics

see https://unix.stackexchange.com/questions/331611 for more information

@edef1c edef1c merged commit 18db80f into NixOS:master Dec 1, 2020
@edef1c edef1c deleted the nix-prefetch-docker-stderr branch December 1, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants