|
@@ -91,8 +91,6 @@ import (
|
|
"sync/atomic"
|
|
"sync/atomic"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
- "github.com/go-logr/logr"
|
|
|
|
-
|
|
|
|
"k8s.io/klog/v2/internal/buffer"
|
|
"k8s.io/klog/v2/internal/buffer"
|
|
"k8s.io/klog/v2/internal/clock"
|
|
"k8s.io/klog/v2/internal/clock"
|
|
"k8s.io/klog/v2/internal/dbg"
|
|
"k8s.io/klog/v2/internal/dbg"
|
|
@@ -453,7 +451,7 @@ type settings struct {
|
|
|
|
|
|
// logger is the global Logger chosen by users of klog, nil if
|
|
// logger is the global Logger chosen by users of klog, nil if
|
|
// none is available.
|
|
// none is available.
|
|
- logger *Logger
|
|
|
|
|
|
+ logger *logWriter
|
|
|
|
|
|
// loggerOptions contains the options that were supplied for
|
|
// loggerOptions contains the options that were supplied for
|
|
// globalLogger.
|
|
// globalLogger.
|
|
@@ -525,6 +523,11 @@ func (s settings) deepCopy() settings {
|
|
}
|
|
}
|
|
s.vmodule.filter = filter
|
|
s.vmodule.filter = filter
|
|
|
|
|
|
|
|
+ if s.logger != nil {
|
|
|
|
+ logger := *s.logger
|
|
|
|
+ s.logger = &logger
|
|
|
|
+ }
|
|
|
|
+
|
|
return s
|
|
return s
|
|
}
|
|
}
|
|
|
|
|
|
@@ -532,11 +535,6 @@ func (s settings) deepCopy() settings {
|
|
type loggingT struct {
|
|
type loggingT struct {
|
|
settings
|
|
settings
|
|
|
|
|
|
- // bufferCache maintains the free list. It uses its own mutex
|
|
|
|
- // so buffers can be grabbed and printed to without holding the main lock,
|
|
|
|
- // for better parallelization.
|
|
|
|
- bufferCache buffer.Buffers
|
|
|
|
-
|
|
|
|
// flushD holds a flushDaemon that frequently flushes log file buffers.
|
|
// flushD holds a flushDaemon that frequently flushes log file buffers.
|
|
// Uses its own mutex.
|
|
// Uses its own mutex.
|
|
flushD *flushDaemon
|
|
flushD *flushDaemon
|
|
@@ -664,7 +662,7 @@ func (l *loggingT) header(s severity.Severity, depth int) (*buffer.Buffer, strin
|
|
|
|
|
|
// formatHeader formats a log header using the provided file name and line number.
|
|
// formatHeader formats a log header using the provided file name and line number.
|
|
func (l *loggingT) formatHeader(s severity.Severity, file string, line int) *buffer.Buffer {
|
|
func (l *loggingT) formatHeader(s severity.Severity, file string, line int) *buffer.Buffer {
|
|
- buf := l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ buf := buffer.GetBuffer()
|
|
if l.skipHeaders {
|
|
if l.skipHeaders {
|
|
return buf
|
|
return buf
|
|
}
|
|
}
|
|
@@ -673,17 +671,18 @@ func (l *loggingT) formatHeader(s severity.Severity, file string, line int) *buf
|
|
return buf
|
|
return buf
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) println(s severity.Severity, logger *logr.Logger, filter LogFilter, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) println(s severity.Severity, logger *logWriter, filter LogFilter, args ...interface{}) {
|
|
l.printlnDepth(s, logger, filter, 1, args...)
|
|
l.printlnDepth(s, logger, filter, 1, args...)
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) printlnDepth(s severity.Severity, logger *logr.Logger, filter LogFilter, depth int, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) printlnDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, args ...interface{}) {
|
|
buf, file, line := l.header(s, depth)
|
|
buf, file, line := l.header(s, depth)
|
|
- // if logger is set, we clear the generated header as we rely on the backing
|
|
|
|
- // logger implementation to print headers
|
|
|
|
- if logger != nil {
|
|
|
|
- l.bufferCache.PutBuffer(buf)
|
|
|
|
- buf = l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ // If a logger is set and doesn't support writing a formatted buffer,
|
|
|
|
+ // we clear the generated header as we rely on the backing
|
|
|
|
+ // logger implementation to print headers.
|
|
|
|
+ if logger != nil && logger.writeKlogBuffer == nil {
|
|
|
|
+ buffer.PutBuffer(buf)
|
|
|
|
+ buf = buffer.GetBuffer()
|
|
}
|
|
}
|
|
if filter != nil {
|
|
if filter != nil {
|
|
args = filter.Filter(args)
|
|
args = filter.Filter(args)
|
|
@@ -692,17 +691,18 @@ func (l *loggingT) printlnDepth(s severity.Severity, logger *logr.Logger, filter
|
|
l.output(s, logger, buf, depth, file, line, false)
|
|
l.output(s, logger, buf, depth, file, line, false)
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) print(s severity.Severity, logger *logr.Logger, filter LogFilter, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) print(s severity.Severity, logger *logWriter, filter LogFilter, args ...interface{}) {
|
|
l.printDepth(s, logger, filter, 1, args...)
|
|
l.printDepth(s, logger, filter, 1, args...)
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) printDepth(s severity.Severity, logger *logr.Logger, filter LogFilter, depth int, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) printDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, args ...interface{}) {
|
|
buf, file, line := l.header(s, depth)
|
|
buf, file, line := l.header(s, depth)
|
|
- // if logr is set, we clear the generated header as we rely on the backing
|
|
|
|
- // logr implementation to print headers
|
|
|
|
- if logger != nil {
|
|
|
|
- l.bufferCache.PutBuffer(buf)
|
|
|
|
- buf = l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ // If a logger is set and doesn't support writing a formatted buffer,
|
|
|
|
+ // we clear the generated header as we rely on the backing
|
|
|
|
+ // logger implementation to print headers.
|
|
|
|
+ if logger != nil && logger.writeKlogBuffer == nil {
|
|
|
|
+ buffer.PutBuffer(buf)
|
|
|
|
+ buf = buffer.GetBuffer()
|
|
}
|
|
}
|
|
if filter != nil {
|
|
if filter != nil {
|
|
args = filter.Filter(args)
|
|
args = filter.Filter(args)
|
|
@@ -714,17 +714,18 @@ func (l *loggingT) printDepth(s severity.Severity, logger *logr.Logger, filter L
|
|
l.output(s, logger, buf, depth, file, line, false)
|
|
l.output(s, logger, buf, depth, file, line, false)
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) printf(s severity.Severity, logger *logr.Logger, filter LogFilter, format string, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) printf(s severity.Severity, logger *logWriter, filter LogFilter, format string, args ...interface{}) {
|
|
l.printfDepth(s, logger, filter, 1, format, args...)
|
|
l.printfDepth(s, logger, filter, 1, format, args...)
|
|
}
|
|
}
|
|
|
|
|
|
-func (l *loggingT) printfDepth(s severity.Severity, logger *logr.Logger, filter LogFilter, depth int, format string, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) printfDepth(s severity.Severity, logger *logWriter, filter LogFilter, depth int, format string, args ...interface{}) {
|
|
buf, file, line := l.header(s, depth)
|
|
buf, file, line := l.header(s, depth)
|
|
- // if logr is set, we clear the generated header as we rely on the backing
|
|
|
|
- // logr implementation to print headers
|
|
|
|
- if logger != nil {
|
|
|
|
- l.bufferCache.PutBuffer(buf)
|
|
|
|
- buf = l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ // If a logger is set and doesn't support writing a formatted buffer,
|
|
|
|
+ // we clear the generated header as we rely on the backing
|
|
|
|
+ // logger implementation to print headers.
|
|
|
|
+ if logger != nil && logger.writeKlogBuffer == nil {
|
|
|
|
+ buffer.PutBuffer(buf)
|
|
|
|
+ buf = buffer.GetBuffer()
|
|
}
|
|
}
|
|
if filter != nil {
|
|
if filter != nil {
|
|
format, args = filter.FilterF(format, args)
|
|
format, args = filter.FilterF(format, args)
|
|
@@ -739,13 +740,14 @@ func (l *loggingT) printfDepth(s severity.Severity, logger *logr.Logger, filter
|
|
// printWithFileLine behaves like print but uses the provided file and line number. If
|
|
// printWithFileLine behaves like print but uses the provided file and line number. If
|
|
// alsoLogToStderr is true, the log message always appears on standard error; it
|
|
// alsoLogToStderr is true, the log message always appears on standard error; it
|
|
// will also appear in the log file unless --logtostderr is set.
|
|
// will also appear in the log file unless --logtostderr is set.
|
|
-func (l *loggingT) printWithFileLine(s severity.Severity, logger *logr.Logger, filter LogFilter, file string, line int, alsoToStderr bool, args ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) printWithFileLine(s severity.Severity, logger *logWriter, filter LogFilter, file string, line int, alsoToStderr bool, args ...interface{}) {
|
|
buf := l.formatHeader(s, file, line)
|
|
buf := l.formatHeader(s, file, line)
|
|
- // if logr is set, we clear the generated header as we rely on the backing
|
|
|
|
- // logr implementation to print headers
|
|
|
|
- if logger != nil {
|
|
|
|
- l.bufferCache.PutBuffer(buf)
|
|
|
|
- buf = l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ // If a logger is set and doesn't support writing a formatted buffer,
|
|
|
|
+ // we clear the generated header as we rely on the backing
|
|
|
|
+ // logger implementation to print headers.
|
|
|
|
+ if logger != nil && logger.writeKlogBuffer == nil {
|
|
|
|
+ buffer.PutBuffer(buf)
|
|
|
|
+ buf = buffer.GetBuffer()
|
|
}
|
|
}
|
|
if filter != nil {
|
|
if filter != nil {
|
|
args = filter.Filter(args)
|
|
args = filter.Filter(args)
|
|
@@ -758,7 +760,7 @@ func (l *loggingT) printWithFileLine(s severity.Severity, logger *logr.Logger, f
|
|
}
|
|
}
|
|
|
|
|
|
// if loggr is specified, will call loggr.Error, otherwise output with logging module.
|
|
// if loggr is specified, will call loggr.Error, otherwise output with logging module.
|
|
-func (l *loggingT) errorS(err error, logger *logr.Logger, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) errorS(err error, logger *logWriter, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) {
|
|
if filter != nil {
|
|
if filter != nil {
|
|
msg, keysAndValues = filter.FilterS(msg, keysAndValues)
|
|
msg, keysAndValues = filter.FilterS(msg, keysAndValues)
|
|
}
|
|
}
|
|
@@ -770,7 +772,7 @@ func (l *loggingT) errorS(err error, logger *logr.Logger, filter LogFilter, dept
|
|
}
|
|
}
|
|
|
|
|
|
// if loggr is specified, will call loggr.Info, otherwise output with logging module.
|
|
// if loggr is specified, will call loggr.Info, otherwise output with logging module.
|
|
-func (l *loggingT) infoS(logger *logr.Logger, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) {
|
|
|
|
|
|
+func (l *loggingT) infoS(logger *logWriter, filter LogFilter, depth int, msg string, keysAndValues ...interface{}) {
|
|
if filter != nil {
|
|
if filter != nil {
|
|
msg, keysAndValues = filter.FilterS(msg, keysAndValues)
|
|
msg, keysAndValues = filter.FilterS(msg, keysAndValues)
|
|
}
|
|
}
|
|
@@ -785,7 +787,7 @@ func (l *loggingT) infoS(logger *logr.Logger, filter LogFilter, depth int, msg s
|
|
// set log severity by s
|
|
// set log severity by s
|
|
func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, keysAndValues ...interface{}) {
|
|
func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string, keysAndValues ...interface{}) {
|
|
// Only create a new buffer if we don't have one cached.
|
|
// Only create a new buffer if we don't have one cached.
|
|
- b := l.bufferCache.GetBuffer()
|
|
|
|
|
|
+ b := buffer.GetBuffer()
|
|
// The message is always quoted, even if it contains line breaks.
|
|
// The message is always quoted, even if it contains line breaks.
|
|
// If developers want multi-line output, they should use a small, fixed
|
|
// If developers want multi-line output, they should use a small, fixed
|
|
// message and put the multi-line output into a value.
|
|
// message and put the multi-line output into a value.
|
|
@@ -796,7 +798,7 @@ func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string,
|
|
serialize.KVListFormat(&b.Buffer, keysAndValues...)
|
|
serialize.KVListFormat(&b.Buffer, keysAndValues...)
|
|
l.printDepth(s, logging.logger, nil, depth+1, &b.Buffer)
|
|
l.printDepth(s, logging.logger, nil, depth+1, &b.Buffer)
|
|
// Make the buffer available for reuse.
|
|
// Make the buffer available for reuse.
|
|
- l.bufferCache.PutBuffer(b)
|
|
|
|
|
|
+ buffer.PutBuffer(b)
|
|
}
|
|
}
|
|
|
|
|
|
// redirectBuffer is used to set an alternate destination for the logs
|
|
// redirectBuffer is used to set an alternate destination for the logs
|
|
@@ -851,7 +853,7 @@ func LogToStderr(stderr bool) {
|
|
}
|
|
}
|
|
|
|
|
|
// output writes the data to the log files and releases the buffer.
|
|
// output writes the data to the log files and releases the buffer.
|
|
-func (l *loggingT) output(s severity.Severity, log *logr.Logger, buf *buffer.Buffer, depth int, file string, line int, alsoToStderr bool) {
|
|
|
|
|
|
+func (l *loggingT) output(s severity.Severity, logger *logWriter, buf *buffer.Buffer, depth int, file string, line int, alsoToStderr bool) {
|
|
var isLocked = true
|
|
var isLocked = true
|
|
l.mu.Lock()
|
|
l.mu.Lock()
|
|
defer func() {
|
|
defer func() {
|
|
@@ -867,13 +869,17 @@ func (l *loggingT) output(s severity.Severity, log *logr.Logger, buf *buffer.Buf
|
|
}
|
|
}
|
|
}
|
|
}
|
|
data := buf.Bytes()
|
|
data := buf.Bytes()
|
|
- if log != nil {
|
|
|
|
- // TODO: set 'severity' and caller information as structured log info
|
|
|
|
- // keysAndValues := []interface{}{"severity", severityName[s], "file", file, "line", line}
|
|
|
|
- if s == severity.ErrorLog {
|
|
|
|
- logging.logger.WithCallDepth(depth+3).Error(nil, string(data))
|
|
|
|
|
|
+ if logger != nil {
|
|
|
|
+ if logger.writeKlogBuffer != nil {
|
|
|
|
+ logger.writeKlogBuffer(data)
|
|
} else {
|
|
} else {
|
|
- log.WithCallDepth(depth + 3).Info(string(data))
|
|
|
|
|
|
+ // TODO: set 'severity' and caller information as structured log info
|
|
|
|
+ // keysAndValues := []interface{}{"severity", severityName[s], "file", file, "line", line}
|
|
|
|
+ if s == severity.ErrorLog {
|
|
|
|
+ logger.WithCallDepth(depth+3).Error(nil, string(data))
|
|
|
|
+ } else {
|
|
|
|
+ logger.WithCallDepth(depth + 3).Info(string(data))
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else if l.toStderr {
|
|
} else if l.toStderr {
|
|
os.Stderr.Write(data)
|
|
os.Stderr.Write(data)
|
|
@@ -948,7 +954,7 @@ func (l *loggingT) output(s severity.Severity, log *logr.Logger, buf *buffer.Buf
|
|
timeoutFlush(ExitFlushTimeout)
|
|
timeoutFlush(ExitFlushTimeout)
|
|
OsExit(255) // C++ uses -1, which is silly because it's anded with 255 anyway.
|
|
OsExit(255) // C++ uses -1, which is silly because it's anded with 255 anyway.
|
|
}
|
|
}
|
|
- l.bufferCache.PutBuffer(buf)
|
|
|
|
|
|
+ buffer.PutBuffer(buf)
|
|
|
|
|
|
if stats := severityStats[s]; stats != nil {
|
|
if stats := severityStats[s]; stats != nil {
|
|
atomic.AddInt64(&stats.lines, 1)
|
|
atomic.AddInt64(&stats.lines, 1)
|
|
@@ -1282,7 +1288,7 @@ func (l *loggingT) setV(pc uintptr) Level {
|
|
// See the documentation of V for more information.
|
|
// See the documentation of V for more information.
|
|
type Verbose struct {
|
|
type Verbose struct {
|
|
enabled bool
|
|
enabled bool
|
|
- logr *logr.Logger
|
|
|
|
|
|
+ logger *logWriter
|
|
}
|
|
}
|
|
|
|
|
|
func newVerbose(level Level, b bool) Verbose {
|
|
func newVerbose(level Level, b bool) Verbose {
|
|
@@ -1290,7 +1296,7 @@ func newVerbose(level Level, b bool) Verbose {
|
|
return Verbose{b, nil}
|
|
return Verbose{b, nil}
|
|
}
|
|
}
|
|
v := logging.logger.V(int(level))
|
|
v := logging.logger.V(int(level))
|
|
- return Verbose{b, &v}
|
|
|
|
|
|
+ return Verbose{b, &logWriter{Logger: v, writeKlogBuffer: logging.loggerOptions.writeKlogBuffer}}
|
|
}
|
|
}
|
|
|
|
|
|
// V reports whether verbosity at the call site is at least the requested level.
|
|
// V reports whether verbosity at the call site is at least the requested level.
|
|
@@ -1313,6 +1319,13 @@ func newVerbose(level Level, b bool) Verbose {
|
|
// less than or equal to the value of the -vmodule pattern matching the source file
|
|
// less than or equal to the value of the -vmodule pattern matching the source file
|
|
// containing the call.
|
|
// containing the call.
|
|
func V(level Level) Verbose {
|
|
func V(level Level) Verbose {
|
|
|
|
+ return VDepth(1, level)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// VDepth is a variant of V that accepts a number of stack frames that will be
|
|
|
|
+// skipped when checking the -vmodule patterns. VDepth(0) is equivalent to
|
|
|
|
+// V().
|
|
|
|
+func VDepth(depth int, level Level) Verbose {
|
|
// This function tries hard to be cheap unless there's work to do.
|
|
// This function tries hard to be cheap unless there's work to do.
|
|
// The fast path is two atomic loads and compares.
|
|
// The fast path is two atomic loads and compares.
|
|
|
|
|
|
@@ -1329,7 +1342,7 @@ func V(level Level) Verbose {
|
|
// but if V logging is enabled we're slow anyway.
|
|
// but if V logging is enabled we're slow anyway.
|
|
logging.mu.Lock()
|
|
logging.mu.Lock()
|
|
defer logging.mu.Unlock()
|
|
defer logging.mu.Unlock()
|
|
- if runtime.Callers(2, logging.pcs[:]) == 0 {
|
|
|
|
|
|
+ if runtime.Callers(2+depth, logging.pcs[:]) == 0 {
|
|
return newVerbose(level, false)
|
|
return newVerbose(level, false)
|
|
}
|
|
}
|
|
// runtime.Callers returns "return PCs", but we want
|
|
// runtime.Callers returns "return PCs", but we want
|
|
@@ -1357,7 +1370,7 @@ func (v Verbose) Enabled() bool {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) Info(args ...interface{}) {
|
|
func (v Verbose) Info(args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.print(severity.InfoLog, v.logr, logging.filter, args...)
|
|
|
|
|
|
+ logging.print(severity.InfoLog, v.logger, logging.filter, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1365,7 +1378,7 @@ func (v Verbose) Info(args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) InfoDepth(depth int, args ...interface{}) {
|
|
func (v Verbose) InfoDepth(depth int, args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.printDepth(severity.InfoLog, v.logr, logging.filter, depth, args...)
|
|
|
|
|
|
+ logging.printDepth(severity.InfoLog, v.logger, logging.filter, depth, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1373,7 +1386,7 @@ func (v Verbose) InfoDepth(depth int, args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) Infoln(args ...interface{}) {
|
|
func (v Verbose) Infoln(args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.println(severity.InfoLog, v.logr, logging.filter, args...)
|
|
|
|
|
|
+ logging.println(severity.InfoLog, v.logger, logging.filter, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1381,7 +1394,7 @@ func (v Verbose) Infoln(args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) InfolnDepth(depth int, args ...interface{}) {
|
|
func (v Verbose) InfolnDepth(depth int, args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.printlnDepth(severity.InfoLog, v.logr, logging.filter, depth, args...)
|
|
|
|
|
|
+ logging.printlnDepth(severity.InfoLog, v.logger, logging.filter, depth, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1389,7 +1402,7 @@ func (v Verbose) InfolnDepth(depth int, args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) Infof(format string, args ...interface{}) {
|
|
func (v Verbose) Infof(format string, args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.printf(severity.InfoLog, v.logr, logging.filter, format, args...)
|
|
|
|
|
|
+ logging.printf(severity.InfoLog, v.logger, logging.filter, format, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1397,7 +1410,7 @@ func (v Verbose) Infof(format string, args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) InfofDepth(depth int, format string, args ...interface{}) {
|
|
func (v Verbose) InfofDepth(depth int, format string, args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.printfDepth(severity.InfoLog, v.logr, logging.filter, depth, format, args...)
|
|
|
|
|
|
+ logging.printfDepth(severity.InfoLog, v.logger, logging.filter, depth, format, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1405,7 +1418,7 @@ func (v Verbose) InfofDepth(depth int, format string, args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) InfoS(msg string, keysAndValues ...interface{}) {
|
|
func (v Verbose) InfoS(msg string, keysAndValues ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.infoS(v.logr, logging.filter, 0, msg, keysAndValues...)
|
|
|
|
|
|
+ logging.infoS(v.logger, logging.filter, 0, msg, keysAndValues...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1419,14 +1432,14 @@ func InfoSDepth(depth int, msg string, keysAndValues ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) InfoSDepth(depth int, msg string, keysAndValues ...interface{}) {
|
|
func (v Verbose) InfoSDepth(depth int, msg string, keysAndValues ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.infoS(v.logr, logging.filter, depth, msg, keysAndValues...)
|
|
|
|
|
|
+ logging.infoS(v.logger, logging.filter, depth, msg, keysAndValues...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// Deprecated: Use ErrorS instead.
|
|
// Deprecated: Use ErrorS instead.
|
|
func (v Verbose) Error(err error, msg string, args ...interface{}) {
|
|
func (v Verbose) Error(err error, msg string, args ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.errorS(err, v.logr, logging.filter, 0, msg, args...)
|
|
|
|
|
|
+ logging.errorS(err, v.logger, logging.filter, 0, msg, args...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1434,7 +1447,7 @@ func (v Verbose) Error(err error, msg string, args ...interface{}) {
|
|
// See the documentation of V for usage.
|
|
// See the documentation of V for usage.
|
|
func (v Verbose) ErrorS(err error, msg string, keysAndValues ...interface{}) {
|
|
func (v Verbose) ErrorS(err error, msg string, keysAndValues ...interface{}) {
|
|
if v.enabled {
|
|
if v.enabled {
|
|
- logging.errorS(err, v.logr, logging.filter, 0, msg, keysAndValues...)
|
|
|
|
|
|
+ logging.errorS(err, v.logger, logging.filter, 0, msg, keysAndValues...)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|