l

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerbosityNameDebug    = "debug"
	VerbosityNameError    = "error"
	VerbosityNameFatal    = "fatal"
	VerbosityNameInfo     = "info"
	VerbosityNameSuccess  = "success"
	VerbosityNameSuppress = "suppress"
	VerbosityNameUnknown  = "unknown"
	VerbosityNameWarn     = "warn"
)

Verbosity level names.

Variables

This section is empty.

Functions

func Error

func Error(err error, msg string, keysAndValues ...interface{})

Error logs an error, with the given message and key/value pairs as context. It functions similarly to Info, but may have unique behavior, and should be preferred for logging errors (see the package documentations for more information). The log message will always be emitted, regardless of verbosity level.

The msg argument should be used to add context to any underlying error, while the err argument should be used to attach the actual error that triggered this log line, if present. The err parameter is optional and nil may be passed instead of an error instance.

func Info

func Info(msg string, keysAndValues ...interface{})

Info logs a non-error message with the given key/value pairs as context.

The msg argument should be used to add some constant description to the log line. The key/value pairs can then be used to add additional variable information. The key/value pairs must alternate string keys and arbitrary values.

func RegisterLogger

func RegisterLogger(ll *logr.Logger)

RegisterLogger registers global logr implementation

func V

func V(level int) logr.Logger

V returns a new Logger instance for a specific verbosity level, relative to this Logger. In other words, V-levels are additive. A higher verbosity level means a log message is less important. Negative V-levels are treated as 0.

Types

type Verbosity

type Verbosity uint32

Verbosity defines the verbosity level of the line printer.

const (
	// FatalVerbosity is the verbosity level of the line printer for fatal messages.
	FatalVerbosity Verbosity = iota
	// ErrorVerbosity is the verbosity level of the line printer for error messages.
	ErrorVerbosity
	// WarnVerbosity is the verbosity level of the line printer for warning messages.
	WarnVerbosity
	// SuccessVerbosity is verbosity the level of the line printer for success messages.
	SuccessVerbosity
	// InfoVerbosity is verbosity the level of the line printer for information messages.
	InfoVerbosity
	// DebugVerbosity is verbosity the level of the line printer for debug messages.
	DebugVerbosity
	// SuppressVerbosity is the verbosity level of the line printer to suppress messages.
	SuppressVerbosity
)

func ParseVerbosity

func ParseVerbosity(lvl string) (Verbosity, error)

ParseVerbosity takes a verbosity level name and returns the Verbosity level constant.

func (Verbosity) MarshalText

func (v Verbosity) MarshalText() ([]byte, error)

MarshalText returns the textual representation of itself.

func (Verbosity) String

func (v Verbosity) String() string

Convert the Verbosity to a string.

func (*Verbosity) UnmarshalText

func (v *Verbosity) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler to unmarshal a textual representation of itself.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL