logging

package
v0.0.0-...-1fa5987 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger Logger) context.Context

func Infof

func Infof(ctx context.Context, format string, v ...any)

func Prefix

func Prefix(prefix, format string) string

Types

type GoLogger

type GoLogger struct {
	Prefix     string
	Underlying *golog.Logger
	CallDepth  int
}

func (*GoLogger) Infof

func (l *GoLogger) Infof(format string, v ...any)

func (*GoLogger) Sublogger

func (l *GoLogger) Sublogger(prefix string) Logger

type Logger

type Logger interface {
	Infof(format string, v ...any)
	Sublogger(prefix string) Logger
}

func CurrentLogger

func CurrentLogger(ctx context.Context) Logger

func Default

func Default() Logger

type NopLogger

type NopLogger struct{}

func (*NopLogger) Infof

func (nop *NopLogger) Infof(format string, v ...any)

func (*NopLogger) Sublogger

func (nop *NopLogger) Sublogger(prefix string) Logger

Jump to

Keyboard shortcuts

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