logutil

package
v3.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxLogKey interface{} = ctxLogKeyType{}

CtxLogKey is the key to retrieve logger from context. It can be assigned to another value.

View Source
var TraceEventKey = "event"

TraceEventKey presents the TraceEventKey in span log.

Functions

func BgLogger

func BgLogger() *zap.Logger

BgLogger returns the default global logger.

func Event

func Event(ctx context.Context, event string)

Event records event in current tracing span.

func Eventf

func Eventf(ctx context.Context, format string, args ...interface{})

Eventf records event in current tracing span with format support.

func Hex

func Hex(msg proto.Message) fmt.Stringer

Hex defines a fmt.Stringer for proto.Message. We can't define the String() method on proto.Message, but we can wrap it.

func Logger

func Logger(ctx context.Context) *zap.Logger

Logger gets a contextual logger from current context. contextual logger will output common fields from context.

func SetTag

func SetTag(ctx context.Context, key string, value interface{})

SetTag sets tag kv-pair in current tracing span

Types

This section is empty.

Jump to

Keyboard shortcuts

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