Documentation ¶
Index ¶
- type Listener
- type LogEntry
- type Logger
- func (l *Logger) Enabled(v int) bool
- func (l *Logger) Error(err error, msg string, kvs ...interface{})
- func (l *Logger) Info(level int, msg string, kvs ...interface{})
- func (l *Logger) Init(info logr.RuntimeInfo)
- func (l *Logger) V(level int) logr.LogSink
- func (l *Logger) WithName(name string) logr.LogSink
- func (l *Logger) WithValues(kvList ...interface{}) logr.LogSink
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener defines a listener for log entries.
func NewListener ¶
NewListener returns a new listener with the specified logger.
func (*Listener) GetEntries ¶
GetEntries returns a copy of the list of log entries.
type LogEntry ¶
type LogEntry struct { // Prefix of the log line, composed of the hierarchy of log.WithName values. Prefix string // LogFunc of the log entry, e.g. "Info", "Error" LogFunc string // Level of the LogEntry. Level int // Values of the log line, composed of the concatenation of log.WithValues and KeyValue pairs passed to log.Info. Values []interface{} }
LogEntry defines the information that can be used for composing a log line.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger defines a test-friendly logr.Logger.
func (*Logger) Init ¶ added in v1.2.0
func (l *Logger) Init(info logr.RuntimeInfo)
Init initializes the logger from runtime information.
func (*Logger) WithValues ¶
WithValues adds some key-value pairs of context to a logger.
type Option ¶
type Option func(*Logger)
Option is a configuration option supplied to NewLogger.
func WithThreshold ¶
WithThreshold implements a New Option that allows to set the threshold level for a new logger. The logger will write only log messages with a level/V(x) equal or higher to the threshold.
func WithWriter ¶
WithWriter configures the logger to write to the io.Writer.