ctxlog

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLogger = errors.New("no logger bind with ctx")
)

Functions

func Debug

func Debug(ctx context.Context, keyvals ...interface{}) error

Debug helper method. get logger from ctx and do level log via kit-level

func Error

func Error(ctx context.Context, keyvals ...interface{}) error

func GetLog

func GetLog(ctx context.Context) log.Logger

GetLog get kit logger which bind with ctx. return nil if no logger set

func GetSafeLog

func GetSafeLog(ctx context.Context) log.Logger

GetSafeLog like GetLog but return log.NopLogger if no logger bind with ctx

func Info

func Info(ctx context.Context, keyvals ...interface{}) error

func SetLog

func SetLog(ctx context.Context, logger log.Logger) context.Context

SetLog bind ctx with logger

func Warn

func Warn(ctx context.Context, keyvals ...interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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