Documentation ¶
Overview ¶
Package log contains the CloudNativePG logging infrastructure
Package log contains the logging subsystem of the instance manager
Index ¶
- Constants
- func Debug(msg string, keysAndValues ...interface{})
- func Enabled() bool
- func Error(err error, msg string, keysAndValues ...interface{})
- func GetFieldsRemapFlags() (res []string)
- func Info(msg string, keysAndValues ...interface{})
- func IntoContext(ctx context.Context, log Logger) context.Context
- func SetLogLevel(level string)
- func SetLogger(logr logr.Logger)
- func Trace(msg string, keysAndValues ...interface{})
- func Warning(msg string, keysAndValues ...interface{})
- type Flags
- type Logger
Constants ¶
const ( // ErrorLevelString is the string representation of the error level ErrorLevelString = "error" // ErrorLevel is the error level priority ErrorLevel = zapcore.ErrorLevel // InfoLevelString is the string representation of the info level InfoLevelString = "info" // InfoLevel is the info level priority InfoLevel = zapcore.InfoLevel // DebugLevelString is the string representation of the debug level DebugLevelString = "debug" // DebugLevel is the debug level priority DebugLevel zapcore.Level = -2 // TraceLevelString is the string representation of the trace level TraceLevelString = "trace" // TraceLevel is the trace level priority TraceLevel zapcore.Level = -4 // WarningLevelString is the string representation of the warning level WarningLevelString = "warning" // WarningLevel is the warning level priority WarningLevel = zapcore.WarnLevel // DefaultLevelString is the string representation of the default level DefaultLevelString = InfoLevelString // DefaultLevel is the default logging level DefaultLevel = InfoLevel )
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(msg string, keysAndValues ...interface{})
Debug exposes the same method from the logr.Logger interface using the default logger
func Enabled ¶
func Enabled() bool
Enabled exposes the same method from the logr.Logger interface using the default logger
func GetFieldsRemapFlags ¶
func GetFieldsRemapFlags() (res []string)
GetFieldsRemapFlags returns the required flags to set the logging fields
func Info ¶
func Info(msg string, keysAndValues ...interface{})
Info exposes the same method from the logr.Logger interface using the default logger
func IntoContext ¶
IntoContext injects a logger into a context
Types ¶
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
Flags contains the set of values necessary for configuring the manager
func (*Flags) ConfigureLogging ¶
func (l *Flags) ConfigureLogging()
ConfigureLogging configure the logging honoring the flags passed from the user This is executed after args were already parsed.
type Logger ¶
type Logger interface { Enabled() bool Error(err error, msg string, keysAndValues ...interface{}) Warning(msg string, keysAndValues ...interface{}) Info(msg string, keysAndValues ...interface{}) Debug(msg string, keysAndValues ...interface{}) Trace(msg string, keysAndValues ...interface{}) WithCaller() Logger WithValues(keysAndValues ...interface{}) Logger WithName(name string) Logger GetLogger() logr.Logger }
Logger is a reduced version of logr.Logger
func FromContext ¶
FromContext builds a logger with some additional information stored in the context
func SetupLogger ¶
SetupLogger sets up the logger from a given context, wrapping it with a new uuid, and any given name
func WithCaller ¶
func WithCaller() Logger
WithCaller exposes the same method from logr.Logger interface using the default logger
func WithName ¶
WithName exposes the same method from the logr.Logger interface using the default logger
func WithValues ¶
func WithValues(keysAndValues ...interface{}) Logger
WithValues exposes the same method from the logr.Logger interface using the default logger