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

test: add unit test case for func WithConsole #1267

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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