mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 21:31:23 +00:00
[log] add NewFilterByLevel helper func
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/tendermint/tmlibs/log"
|
||||
)
|
||||
|
||||
@ -107,3 +108,15 @@ func TestLevelContext(t *testing.T) {
|
||||
t.Errorf("\nwant '%s'\nhave '%s'", want, have)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewFilterByLevel(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
var logger log.Logger
|
||||
logger = log.NewNopLogger()
|
||||
assert.NotPanics(func() {
|
||||
logger = log.NewFilterByLevel(logger, "info")
|
||||
})
|
||||
assert.Panics(func() {
|
||||
logger = log.NewFilterByLevel(logger, "smth")
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user