logging

package
v0.0.0-...-cb5ecd6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 5 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(msg string, keyvals ...interface{})

Types

type Logger

type Logger interface {
	Log(ctx context.Context, msg string, keyvals ...interface{})

	// Sync flushes the buffer and writes any pending logs.
	Sync() error
}

type SugaredZapLogger

type SugaredZapLogger struct {
	// contains filtered or unexported fields
}

SugaredZapLogger is a wrapper for otelzap.SugaredLogger and implements Logger and grpclog.LoggerV2 interfaces.

func NewLogger

func NewLogger() (SugaredZapLogger, error)

NewLogger returns a new logger safe for concurrent use.

func (SugaredZapLogger) Error

func (logger SugaredZapLogger) Error(args ...any)

Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.

func (SugaredZapLogger) Errorf

func (logger SugaredZapLogger) Errorf(format string, args ...any)

Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.

func (SugaredZapLogger) Errorln

func (logger SugaredZapLogger) Errorln(args ...any)

Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.

func (SugaredZapLogger) Fatal

func (logger SugaredZapLogger) Fatal(args ...any)

Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. gRPC ensures that all Fatal logs will exit with os.Exit(1). Implementations may also call os.Exit() with a non-zero exit code.

func (SugaredZapLogger) Fatalf

func (logger SugaredZapLogger) Fatalf(format string, args ...any)

Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. gRPC ensures that all Fatal logs will exit with os.Exit(1). Implementations may also call os.Exit() with a non-zero exit code.

func (SugaredZapLogger) Fatalln

func (logger SugaredZapLogger) Fatalln(args ...any)

Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. gRPC ensures that all Fatal logs will exit with os.Exit(1). Implementations may also call os.Exit() with a non-zero exit code.

func (SugaredZapLogger) Info

func (logger SugaredZapLogger) Info(args ...any)

Info logs to INFO log. Arguments are handled in the manner of fmt.Print.

func (SugaredZapLogger) Infof

func (logger SugaredZapLogger) Infof(format string, args ...any)

Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.

func (SugaredZapLogger) Infoln

func (logger SugaredZapLogger) Infoln(args ...any)

Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.

func (SugaredZapLogger) Log

func (logger SugaredZapLogger) Log(ctx context.Context, msg string, keyvals ...interface{})

func (SugaredZapLogger) Sync

func (logger SugaredZapLogger) Sync() error

func (SugaredZapLogger) V

func (logger SugaredZapLogger) V(l int) bool

V reports whether verbosity level l is at least the requested verbose level.

func (SugaredZapLogger) Warning

func (logger SugaredZapLogger) Warning(args ...any)

Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.

func (SugaredZapLogger) Warningf

func (logger SugaredZapLogger) Warningf(format string, args ...any)

Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.

func (SugaredZapLogger) Warningln

func (logger SugaredZapLogger) Warningln(args ...any)

Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.

Jump to

Keyboard shortcuts

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