Documentation ¶
Index ¶
- func Ctx(ctx context.Context) logr.Logger
- func Error(err error, msg string, keysAndValues ...interface{})
- func FromContext(ctx context.Context) logr.Logger
- func Info(msg string, keysAndValues ...interface{})
- func Logger() logr.Logger
- func V(level int) logr.Logger
- func WithContext(parent context.Context, logger logr.Logger) context.Context
- func WithName(name string) logr.Logger
- func WithValues(keysAndValues ...interface{}) logr.Logger
Constants ¶
This section is empty.
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 calling Info with the "error" named value, but may have unique behavior, and should be preferred for logging errors (see the package documentations for more information).
The msg field should be used to add context to any underlying error, while the err field should be used to attach the actual error that triggered this log line, if present.
func FromContext ¶
FromContext returns the logger from context.
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 should alternate string keys and arbitrary values.
func V ¶
V returns an Logger value for a specific verbosity level, relative to this Logger. In other words, V values are additive. V higher verbosity level means a log message is less important. It's illegal to pass a log level less than zero.
func WithContext ¶
WithContext returns a copy of parent in which the logger value is set
func WithName ¶
WithName adds a new element to the logger's name. Successive calls with WithName continue to append suffixes to the logger's name. It's strongly recommended that name segments contain only letters, digits, and hyphens (see the package documentation for more information).
func WithValues ¶
WithValues adds some key-value pairs of context to a logger. See Info for documentation on how key/value pairs work.
Types ¶
This section is empty.