MCPcopy
hub / github.com/rs/zerolog / WriteLevel

Method WriteLevel

writer.go:209–214  ·  view source on GitHub ↗

WriteLevel calls WriteLevel of the underlying Writer only if the level is equal or above the Level.

(level Level, p []byte)

Source from the content-addressed store, hash-verified

207// WriteLevel calls WriteLevel of the underlying Writer only if the level is equal
208// or above the Level.
209func (w *FilteredLevelWriter) WriteLevel(level Level, p []byte) (int, error) {
210 if level >= w.Level {
211 return w.Writer.WriteLevel(level, p)
212 }
213 return len(p), nil
214}
215
216// Call the underlying writer's Close method if it is an io.Closer. Otherwise
217// does nothing.

Callers 1

TestFilteredLevelWriterFunction · 0.95

Calls 1

WriteLevelMethod · 0.65

Tested by 1

TestFilteredLevelWriterFunction · 0.76