Documentation
¶
Index ¶
- Constants
- func WithEventRecorder(logger logr.LogSink, recorder record.EventRecorder, object runtime.Object) logr.Logger
- func WithLabels(logger logr.Logger, labels map[string]string, labelKeyPrefix string) logr.Logger
- func WithNoRecord(logger logr.Logger) logr.Logger
- type EventRecordingLogSink
- func (erl *EventRecordingLogSink) Enabled(level int) bool
- func (erl *EventRecordingLogSink) Error(err error, msg string, keysAndValues ...interface{})
- func (erl *EventRecordingLogSink) Info(levels int, msg string, keyvals ...interface{})
- func (erl *EventRecordingLogSink) Init(info logr.RuntimeInfo)
- func (erl *EventRecordingLogSink) WithName(name string) logr.LogSink
- func (erl *EventRecordingLogSink) WithValues(values ...interface{}) logr.LogSink
Constants ¶
const ( // EventTypeDontRecord will tell the logger not to emit a Kubernetes event for this log // line EventTypeDontRecord = "DontRecord" )
Variables ¶
This section is empty.
Functions ¶
func WithEventRecorder ¶
func WithLabels ¶
WithLabels decorates a logr.Logger so that any log entries contain all labels which keys are prefix by labelKeyPrefix
Types ¶
type EventRecordingLogSink ¶
type EventRecordingLogSink struct {
// contains filtered or unexported fields
}
func (*EventRecordingLogSink) Enabled ¶
func (erl *EventRecordingLogSink) Enabled(level int) bool
Enabled tests whether this Logger is enabled. For example, commandline flags might be used to set the logging verbosity and disable some info logs. Enabled implements logr.LogSink.
func (*EventRecordingLogSink) Error ¶
func (erl *EventRecordingLogSink) Error(err error, msg string, keysAndValues ...interface{})
Error logs an error, with the given message and key/value pairs as context. It functions similarly to calling Info with the "error" named value, but may have unique behavior, and should be preferred for logging errors (see the package documentations for more information).
The msg field should be used to add context to any underlying error, while the err field should be used to attach the actual error that triggered this log line, if present.
Error implements logr.LogSink.
func (*EventRecordingLogSink) Info ¶
func (erl *EventRecordingLogSink) Info(levels int, msg string, keyvals ...interface{})
Info implements logr.LogSink.
func (*EventRecordingLogSink) Init ¶
func (erl *EventRecordingLogSink) Init(info logr.RuntimeInfo)
Init implements logr.LogSink.
func (*EventRecordingLogSink) WithName ¶
func (erl *EventRecordingLogSink) WithName(name string) logr.LogSink
WithName implements logr.LogSink.
func (*EventRecordingLogSink) WithValues ¶
func (erl *EventRecordingLogSink) WithValues(values ...interface{}) logr.LogSink
WithValues implements logr.LogSink.