From 84d5de04d3ec612db24710d5098599aacde66e92 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 8 Feb 2024 02:31:47 +0800 Subject: [PATCH] fix: avoid cli redundant log in stdout (#19371) --- CHANGELOG-Agoric.md | 4 ++++ crypto/keyring/keyring.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-Agoric.md b/CHANGELOG-Agoric.md index 2335f6821f55..3193460d81d1 100644 --- a/CHANGELOG-Agoric.md +++ b/CHANGELOG-Agoric.md @@ -39,6 +39,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Agoric/agoric-sdk#8871 Have `tx gov submit-proposal` accept either new or legacy syntax +### Bug Fixes + +* (crypto) [#19371](https://github.com/cosmos/cosmos-sdk/pull/19371) Avoid cli redundant log in stdout, log to stderr instead. + ## `v0.46.16-alpha.agoric.1` - 2024-02-05 * Agoric/agoric-sdk#8224 Merge [cosmos/cosmos-sdk v0.46.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.16) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 43aff2c2de92..91b1ca0f9ae5 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -856,7 +856,7 @@ func (ks keystore) MigrateAll() ([]*Record, error) { rec, err := ks.migrate(key) if err != nil { - fmt.Printf("migrate err for key %s: %q\n", key, err) + fmt.Fprintf(os.Stderr, "migrate err for key %s: %q\n", key, err) continue } @@ -926,7 +926,7 @@ func (ks keystore) migrate(key string) (*Record, error) { return nil, fmt.Errorf("unable to set keyring.Item, err: %w", err) } - fmt.Printf("Successfully migrated key %s.\n", key) + fmt.Fprintf(os.Stderr, "Successfully migrated key %s.\n", key) return k, nil }