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