check level, add test

This commit is contained in:
Caleb Doxsey 2023-07-19 13:48:22 -06:00
parent ce1dc56f49
commit c33b4dc5f6
2 changed files with 31 additions and 0 deletions

View file

@ -23,6 +23,9 @@ func (c certMagicLoggerCore) With(fs []zapcore.Field) zapcore.Core {
}
func (c certMagicLoggerCore) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry {
if !c.Enabled(e.Level) {
return ce
}
return ce.AddCore(e, c)
}