Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
test: add unit test case for func WithConsole
Browse files Browse the repository at this point in the history
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
  • Loading branch information
Guangwen Feng committed Apr 3, 2020
1 parent 18b652c commit f9a86be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/dflog/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ func (ts *logTestSuite) TestMaxSizeMB() {
r.Equal(20, lumberjack.MaxSize)
}

func (ts *logTestSuite) TestConsole() {
r := ts.Require()

l := logrus.New()
r.Nil(Init(l, WithConsole()))
for _, level := range logrus.AllLevels {
r.Equal(1, len(l.Hooks[level]))
}
}

func (ts *logTestSuite) TestFormatter() {
r := ts.Require()

Expand Down

0 comments on commit f9a86be

Please sign in to comment.