Documentation ¶
Index ¶
- func NewErrorStandardLogger(logger logur.Logger) *log.Logger
- func NewLogger(config Config) logur.LoggerFacade
- func NewLogrusLogger(config Config) *logrus.Logger
- func SetK8sLogger(logger logur.Logger)
- func SetStandardLogger(logger logur.Logger)
- func WithFields(logger logur.Logger, fields map[string]interface{}) logur.LoggerFacade
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorStandardLogger ¶
NewErrorStandardLogger returns a new standard logger logging on error level.
func NewLogrusLogger ¶
NewLogrusLogger creates a new logrus logger instance.
func SetK8sLogger ¶
SetK8sLogger overrides the default klog instance. By default klog tries to write into the filesystem, which doesn't work with scratch containers (there is no /tmp dir), so we override it entirely. See https://github.com/kubernetes/apimachinery/blob/052f7ea/pkg/util/runtime/runtime.go#L78
func SetStandardLogger ¶
SetStandardLogger sets the global logger's output to a custom logger instance.
func WithFields ¶
func WithFields(logger logur.Logger, fields map[string]interface{}) logur.LoggerFacade
WithFields returns a new contextual logger instance with context added to it.
Types ¶
type Config ¶
type Config struct { // Format specifies the output log format. // Accepted values are: json, logfmt/text Format string // Level is the minimum log level that should appear on the output. Level string // NoColor makes sure that no log output gets colorized. NoColor bool }
Config holds details necessary for logging.
Click to show internal directories.
Click to hide internal directories.