Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit cbfc36c

Browse files
authored
Merge pull request #1267 from fenggw-fnst/work
test: add unit test case for func WithConsole
2 parents 05b2f8e + 0ab5157 commit cbfc36c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/dflog/log_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ func (ts *logTestSuite) TestMaxSizeMB() {
7272
r.Equal(20, lumberjack.MaxSize)
7373
}
7474

75+
func (ts *logTestSuite) TestConsole() {
76+
r := ts.Require()
77+
78+
l := logrus.New()
79+
r.Nil(Init(l, WithConsole()))
80+
for _, level := range logrus.AllLevels {
81+
r.Equal(1, len(l.Hooks[level]))
82+
}
83+
}
84+
7585
func (ts *logTestSuite) TestFormatter() {
7686
r := ts.Require()
7787

0 commit comments

Comments
 (0)