Skip to content

Why doesn't the Error function have the judgment of l.sink.Enabled(l. level) like the Info function #394

@chymy

Description

@chymy

Why doesn't the Error function have the judgment of l.sink.Enabled(l. level) like the Info function

logr/logr.go

Lines 294 to 302 in f9181c4

func (l Logger) Error(err error, msg string, keysAndValues ...any) {
if l.sink == nil {
return
}
if withHelper, ok := l.sink.(CallStackHelperLogSink); ok {
withHelper.GetCallStackHelper()()
}
l.sink.Error(err, msg, keysAndValues...)
}

which causes logger.V(level).Error level to be invalid no matter what it is set to

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions