Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in production. DebugLevel = Level(zapcore.DebugLevel) // InfoLevel is the default logging priority. InfoLevel = Level(zapcore.InfoLevel) // WarnLevel logs are more important than Info, but don't need individual human review. WarnLevel = Level(zapcore.WarnLevel) // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = Level(zapcore.ErrorLevel) // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel = Level(zapcore.DPanicLevel) // PanicLevel logs a message, then panics. PanicLevel = Level(zapcore.PanicLevel) // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = Level(zapcore.FatalLevel) )
Variables ¶
View Source
var ( // Log is the base logger Log logr.Logger = logr.New(ctrllog.NullLogSink{}) )
Functions ¶
func SetLevel ¶
SetLevel sets Options.LogLevel, which configures the the minimum enabled logging level e.g Debug, Info.
Types ¶
type Mode ¶
type Mode int8
Mode defines the log output mode.
const ( // ModeProd is the log mode for production. ModeProd Mode = iota // ModeDev is for more human-readable outputs, extra stack traces // and logging info. (aka Zap's "development config".) // https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/log/zap#UseDevMode ModeDev )
type Options ¶
type Options struct { // LogLevel configures the verbosity of the logging. LogLevel Level // LogMode defines the log output mode. LogMode Mode // DestWriter controls the destination of the log output. Defaults to // os.Stderr. DestWriter io.Writer }
Options contains all possible settings.
Click to show internal directories.
Click to hide internal directories.