log

package
v0.0.0-...-21a76b1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 10 Imported by: 0

Documentation

Overview

Package log contains the global logger for the vineyard operator.

Index

Constants

This section is empty.

Variables

View Source
var (
	Log = Logger{logr.New(dlog).WithName("vineyard")}
)

Functions

func Error

func Error(err error, msg string, keysAndValues ...any)

func Errorf

func Errorf(err error, format string, v ...any)

func Fatal

func Fatal(err error, msg string, keysAndValues ...any)

func Fatalf

func Fatalf(err error, format string, v ...any)

func Info

func Info(msg string, keysAndValues ...any)

func Infof

func Infof(format string, v ...any)

func IntoContext

func IntoContext(ctx context.Context, log Logger) context.Context

IntoContext takes a context and sets the logger as one of its values. Use FromContext function to retrieve the logger.

func Output

func Output(msg string)

func Outputf

func Outputf(msg string, keysAndValues ...any)

func SetLogLevel

func SetLogLevel(level int)

func SetLogger

func SetLogger(l Logger)

SetLogger sets a concrete logging implementation for all deferred Loggers.

Types

type EscapeSeqJSONEncoder

type EscapeSeqJSONEncoder struct {
	zapcore.Encoder
}

func (*EscapeSeqJSONEncoder) Clone

func (enc *EscapeSeqJSONEncoder) Clone() zapcore.Encoder

func (*EscapeSeqJSONEncoder) EncodeEntry

func (enc *EscapeSeqJSONEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error)

type Logger

type Logger struct {
	logr.Logger
}

Extends the logr's logger with Fatal support

func FromContext

func FromContext(ctx context.Context, keysAndValues ...any) Logger

FromContext returns a logger with predefined values from a context.Context.

func V

func V(level int) Logger

func WithName

func WithName(name string) Logger

func WithValues

func WithValues(keysAndValues ...any) Logger

func (Logger) Errorf

func (l Logger) Errorf(err error, format string, v ...any)

func (Logger) Fatal

func (l Logger) Fatal(err error, msg string, keysAndValues ...any)

func (Logger) Fatalf

func (l Logger) Fatalf(err error, format string, v ...any)

func (Logger) Infof

func (l Logger) Infof(format string, v ...any)

func (Logger) Output

func (l Logger) Output(msg string)

func (Logger) Outputf

func (l Logger) Outputf(format string, v ...any)

Jump to

Keyboard shortcuts

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