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

Commit

Permalink
Merge pull request #1267 from fenggw-fnst/work
Browse files Browse the repository at this point in the history
test: add unit test case for func WithConsole
  • Loading branch information
lowzj authored Apr 9, 2020
2 parents 05b2f8e + 0ab5157 commit cbfc36c
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 cbfc36c

Please sign in to comment.