Skip to content

Commit

Permalink
bump up default log level to warn, verbose to info
Browse files Browse the repository at this point in the history
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
  • Loading branch information
riyazdf committed Jun 5, 2017
1 parent 6767b98 commit c13f5e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/notary/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cmd/notary/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit c13f5e0

Please sign in to comment.