logger

package
v0.0.0-...-d40419c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

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

func Fatal

func Fatal(err error, msg string)

Fatal is equivalent to Get().Error() followed by a call to os.Exit(1).

func Get

func Get() logr.Logger

Get returns the logger instance that has been previously set. If no logger has been set, it returns a null logger.

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 InitZap

func InitZap(level int, opts ...LoggerOpt) error

InitZap creates a zap logger with the provided verbosity level and sets it as the package logger. 0 is the least verbose and 10 the most verbose. The package logger can only be init once, so subsequent calls to this method won't have any effect

func MarkFail

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

func MarkPass

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

func MarkSuccess

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

func MaxLogging

func MaxLogging() bool

func MaxLoggingLevel

func MaxLoggingLevel() int

func NullTimeEncoder

func NullTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

NullTimeEncoder skips time serialization

func V

func V(level int) logr.Logger

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 VLevelEncoder

func VLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)

VLevelEncoder serializes a Level to V + v-level number,

Types

type LoggerOpt

type LoggerOpt func(logr *logr.Logger)

func WithName

func WithName(name string) LoggerOpt

Jump to

Keyboard shortcuts

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