func (f *LevelFilter) Check(line []byte) bool {
	f.once.Do(f.init)
	var level LogLevel
	x := bytes.IndexByte(line, '[')
	if x >= 0 {
		y := bytes.IndexByte(line[x:], ']')
		if y >= 0 {
			level = LogLevel(line[x+1 : x+y])
		}
	}
	_, ok := f.badLevels[level]
	return !ok
}
Check will check a given line if it would be included in the level
filter.
package logutils
import (
	"bytes"
	"io"
	"sync"
)
type LogLevel string
type LevelFilter struct {
	Levels []LogLevel
	MinLevel LogLevel
	Writer io.Writer
	badLevels map[LogLevel]struct{}
	once      sync.Once
}