Check for ignored with fully formatted log message (#1163)
This commit is contained in:
@@ -51,10 +51,11 @@ func (l *logAdapter) Infof(format string, args ...interface{}) {
|
|||||||
if l.level > zapcore.InfoLevel {
|
if l.level > zapcore.InfoLevel {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if l.shouldIgnore(format) {
|
msg := fmt.Sprintf(format, args...)
|
||||||
|
if l.shouldIgnore(msg) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
l.logger.Info(fmt.Sprintf(format, args...))
|
l.logger.Info(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *logAdapter) Warn(msg string) {
|
func (l *logAdapter) Warn(msg string) {
|
||||||
@@ -71,10 +72,11 @@ func (l *logAdapter) Warnf(format string, args ...interface{}) {
|
|||||||
if l.level > zapcore.WarnLevel {
|
if l.level > zapcore.WarnLevel {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if l.shouldIgnore(format) {
|
msg := fmt.Sprintf(format, args...)
|
||||||
|
if l.shouldIgnore(msg) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
l.logger.V(-1).Info(fmt.Sprintf(format, args...))
|
l.logger.V(-1).Info(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *logAdapter) Error(msg string) {
|
func (l *logAdapter) Error(msg string) {
|
||||||
@@ -91,10 +93,11 @@ func (l *logAdapter) Errorf(format string, args ...interface{}) {
|
|||||||
if l.level > zapcore.ErrorLevel {
|
if l.level > zapcore.ErrorLevel {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if l.shouldIgnore(format) {
|
msg := fmt.Sprintf(format, args...)
|
||||||
|
if l.shouldIgnore(msg) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
l.logger.Error(nil, fmt.Sprintf(format, args...))
|
l.logger.Error(nil, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *logAdapter) shouldIgnore(msg string) bool {
|
func (l *logAdapter) shouldIgnore(msg string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user