Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntoContext ¶
IntoContext takes a context and sets the logger as one of its values. Use FromContext function to retrieve the logger.
Types ¶
type LogLevel ¶
func ToLogLevel ¶
ToLogLevel converts a string to a log level.
type LogMode ¶
type LogMode int8
LogMode defines the log output mode.
type Logger ¶
var ( // Log is a singleton base logger that can be used across the system, // either directly or to create other loggers with name, with values, // and/or locked to a given log level. // It is initialized to the promise delegation log provided by // sigs.k8s.io/controller-runtime, which points to a no-op (null) logger // until `SetLogger` is called. // This is also useful for mocking the default logger tests. Log Logger = ctrl.Log )
func FromContext ¶
FromContext returns a logger with predefined values from a context.Context.
func NewLogger ¶
NewLogger returns a new logger with the given options. `logger` param is the actual logger implementation; when omitted, a new logger based on sigs.k8s.io/controller-runtime/pkg/log/zap is created.
func WithValues ¶
func WithValues(keysAndValues ...interface{}) Logger
WithName uses the singleton logger to create a new logger with the given values.
Click to show internal directories.
Click to hide internal directories.