Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
// Info logs a message with optional structured data. Structured data must
// be supplied as an array that alternates between string keys and values of
// an arbitrary type. Use Info for messages that operators are
// very likely to be concerned with when running.
Info(msg string, keysAndValues ...any)
// Debug logs a message with optional structured data. Structured data must
// be supplied as an array that alternates between string keys and values of
// an arbitrary type. Use Debug for messages that operators or
// developers may be concerned with when debugging.
Debug(msg string, keysAndValues ...any)
// Error logs an error with a message and optional structured data.
// Structured data must be supplied as an array that alternates between
// string keys and values of an arbitrary type. Use Error for messages
Error(err error, msg string, keysAndValues ...any)
// Warn logs a message with optional structured data. Structured data must
// be supplied as an array that alternates between string keys and values of
// an arbitrary type. Use Warn for messages that operators should be aware of.
Warn(msg string, keysAndValues ...any)
// WithValues returns a Logger that will include the supplied structured
// data with any subsequent messages it logs. Structured data must
// be supplied as an array that alternates between string keys and values of
// an arbitrary type.
WithValues(keysAndValues ...any) Logger
// WithName returns a Logger that will include the supplied name with any
// subsequent messages it logs. The name is typically a component name or
// similar, and should be used to distinguish between different components
// or subsystems.
WithName(name string) Logger
}
A Logger logs messages. Messages may be supplemented by structured data.
func NewLogrLogger ¶
NewLogrLogger returns a Logger that is satisfied by the supplied logr.Logger, which may be satisfied in turn by various logging implementations (Zap, klog, etc). Debug messages are logged at V(1).
func NewSlogLogger ¶
Click to show internal directories.
Click to hide internal directories.