logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogGRPC added in v1.0.0

func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

Types

type Logger

type Logger struct {
	Klogr logr.Logger
}

func GetLogger

func GetLogger(ctx context.Context) *Logger

GetLogger retrieves the Logger from the context, or creates a new one if not present.

func NewLogger

func NewLogger(ctx context.Context) *Logger

NewLogger creates a new Logger instance with a klogr logger.

func (*Logger) Error

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

Error logs an error message with the specified keys and values.

func (*Logger) V

func (l *Logger) V(level int) logr.Logger

V returns a logr.Logger with the specified verbosity level.

func (*Logger) WithMethod

func (l *Logger) WithMethod(method string) (*Logger, context.Context, func())

WithMethod returns a new Logger with method and traceID values, a context containing the new Logger, and a function to log method completion.

type LoggerKey

type LoggerKey struct{}

Jump to

Keyboard shortcuts

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