Documentation
¶
Index ¶
Constants ¶
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 ¶
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 ¶
RegisterLogger registers global logr implementation
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 ¶
ParseVerbosity takes a verbosity level name and returns the Verbosity level constant.
func (Verbosity) MarshalText ¶
MarshalText returns the textual representation of itself.
func (*Verbosity) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler to unmarshal a textual representation of itself.