Documentation
¶
Index ¶
- func SetLog(log logr.Logger)
- type Log
- func (l *Log) Debug(msg string, keysAndValues ...interface{})
- func (l *Log) Error(err error, msg string, keysAndValues ...interface{})
- func (l *Log) Info(msg string, keysAndValues ...interface{})
- func (l *Log) Trace(msg string, keysAndValues ...interface{})
- func (l *Log) Warning(msg string, keysAndValues ...interface{})
- func (l *Log) WithName(name string) *Log
- func (l *Log) WithValues(keysAndValues ...interface{}) *Log
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log logs messages to various levels.
Based on the go-logr package.
The Log type enables various verbosity levels to be logged based on to the --zap-level argument to the operator.
To create an instance of the log named "main":
log := log.NewLog("main")
When --zap-level is not provided then the logging defaults to INFO level where log.Warning() and log.Info() are logged,
if --zap-level is set to 1 then the logging goes to the DEBUG level where log.Debug() is logged,
while the --zap-level set to 2 is reserved for a finer DEBUG-level logging provided by the log.Trace() function.
func (*Log) WithName ¶
WithName adds a new element to the log's name. Successive calls with WithName continue to append suffixes to the log's name. It's strongly reccomended that name segments contain only letters, digits, and hyphens (see the package documentation for more information).
func (*Log) WithValues ¶
WithValues adds some key-value pairs of context to a log. See Info for documentation on how key/value pairs work.