-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: prevalent stdout/stderr stream confusion #19368
Labels
Comments
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
What happened?
When using output from
appd keys show -a MYKEY --keyring-backend=test
in a script, I had flaky results. After spending considerable time narrowing it down, the problem was sometimes the output would be:and sometimes it was:
CLIs that are designed to produce machine-readable output should not frustrate attempts to consume
stdout
with corner-cases that interrupt the standard behaviour. This goes much further than just the"Sucessfully migrated key..."
message incosmos-sdk/crypto/keyring/keyring.go
. I would expect a careful audit of all uses offmt.Print*
in the SDK, and where the output is not usefully capturable by a calling program, it should be directed atstderr
instead.I recognise that the converse also needs to be true: if writes to
os.Stderr
are usefully capturable by a calling program, they should be directed atstdout
.Cosmos SDK Version
main
How to reproduce?
Search the SDK for
fmt\.Print
, and observe its use within libraries such ascrypto
.The text was updated successfully, but these errors were encountered: