forked from mirror/logrus
Extended test.
This commit is contained in:
parent
be4b44b806
commit
0143a90f6e
|
@ -12,6 +12,8 @@ func TestAllHooks(t *testing.T) {
|
|||
assert := assert.New(t)
|
||||
|
||||
logger, hook := NewNullLogger()
|
||||
assert.Nil(hook.LastEntry())
|
||||
assert.Equal(0, len(hook.Entries))
|
||||
|
||||
logger.Error("Hello error")
|
||||
assert.Equal(logrus.ErrorLevel, hook.LastEntry().Level)
|
||||
|
@ -24,6 +26,7 @@ func TestAllHooks(t *testing.T) {
|
|||
assert.Equal(2, len(hook.Entries))
|
||||
|
||||
hook.Reset()
|
||||
assert.Nil(hook.LastEntry())
|
||||
assert.Equal(0, len(hook.Entries))
|
||||
|
||||
hook = NewGlobal()
|
||||
|
|
Loading…
Reference in New Issue