diff --git a/cmd/notary/integration_test.go b/cmd/notary/integration_test.go index 96eddcc45..21ad0d317 100644 --- a/cmd/notary/integration_test.go +++ b/cmd/notary/integration_test.go @@ -1725,12 +1725,12 @@ func TestLogLevelFlags(t *testing.T) { // Test default to fatal n := notaryCommander{} n.setVerbosityLevel() - require.Equal(t, "fatal", logrus.GetLevel().String()) + require.Equal(t, "warning", logrus.GetLevel().String()) // Test that verbose (-v) sets to error n.verbose = true n.setVerbosityLevel() - require.Equal(t, "error", logrus.GetLevel().String()) + require.Equal(t, "info", logrus.GetLevel().String()) // Test that debug (-D) sets to debug n.debug = true diff --git a/cmd/notary/main.go b/cmd/notary/main.go index 672ffca91..1aae07ada 100644 --- a/cmd/notary/main.go +++ b/cmd/notary/main.go @@ -243,14 +243,14 @@ func getPassphraseRetriever() notary.PassRetriever { } } -// Set the logging level to fatal on default, or the most specific level the user specified (debug or error) +// Set the logging level to warn on default, or the most verbose level the user specified (debug, info) func (n *notaryCommander) setVerbosityLevel() { if n.debug { logrus.SetLevel(logrus.DebugLevel) } else if n.verbose { - logrus.SetLevel(logrus.ErrorLevel) + logrus.SetLevel(logrus.InfoLevel) } else { - logrus.SetLevel(logrus.FatalLevel) + logrus.SetLevel(logrus.WarnLevel) } logrus.SetOutput(os.Stderr) } diff --git a/utils/keys.go b/utils/keys.go index 3d6c65e03..581f11f34 100644 --- a/utils/keys.go +++ b/utils/keys.go @@ -33,7 +33,7 @@ func ExportKeysByGUN(to io.Writer, s Exporter, gun string) error { for _, loc := range keys { keyFile, err := s.Get(loc) if err != nil { - logrus.Info("Could not parse key file at ", loc) + logrus.Warn("Could not parse key file at ", loc) continue } block, _ := pem.Decode(keyFile) @@ -203,7 +203,7 @@ func checkValidity(block *pem.Block) (string, error) { case tufdata.CanonicalSnapshotRole.String(), tufdata.CanonicalTargetsRole.String(), tufdata.CanonicalTimestampRole.String(): // check if the key is missing a gun header or has an empty gun and error out since we don't know what gun it belongs to if block.Headers["gun"] == "" { - logrus.Infof("failed to import key (%s) to store: Cannot have canonical role key without a gun, don't know what gun it belongs to", block.Headers["path"]) + logrus.Warnf("failed to import key (%s) to store: Cannot have canonical role key without a gun, don't know what gun it belongs to", block.Headers["path"]) return "", errors.New("invalid key pem block") } default: @@ -219,7 +219,7 @@ func checkValidity(block *pem.Block) (string, error) { decodedKey, err := utils.ParsePEMPrivateKey(pem.EncodeToMemory(block), "") if err != nil { - logrus.Info("failed to import key to store: Invalid key generated, key may be encrypted and does not contain path header") + logrus.Warn("failed to import key to store: Invalid key generated, key may be encrypted and does not contain path header") return "", errors.New("invalid key pem block") } loc = decodedKey.ID()