Skip to content

Commit

Permalink
set log.Level to Error when using -q
Browse files Browse the repository at this point in the history
  • Loading branch information
frapposelli committed May 14, 2018
1 parent df0393d commit 67b0263
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

type cliOpts struct {
List `command:"list" alias:"ls" description:"List licenses"`
Check `command:"check" alias:"chk" description:"Check licenses against config file"`
List `command:"list" alias:"ls" description:"List licenses"`
Check `command:"check" alias:"chk" description:"Check licenses against config file"`
VersionFlag func() error `long:"version" short:"v" description:"Show CLI version"`

Quiet func() error `short:"q" long:"quiet" description:"quiet mode, do not log accepted packages"`
Expand All @@ -33,7 +33,7 @@ var (
)

func setQuiet() error {
log.SetLevel(log.WarnLevel)
log.SetLevel(log.ErrorLevel)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestCliQuiet(t *testing.T) {
assert.NoError(t, err)

after := log.GetLevel()
assert.Equal(t, log.WarnLevel, after)
assert.Equal(t, log.ErrorLevel, after)
}

func TestCliCheck(t *testing.T) {
Expand Down

0 comments on commit 67b0263

Please sign in to comment.