bklog

package
v0.0.0-...-2745715 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EnableLogWithTraceID

func EnableLogWithTraceID(b bool)

func GetLogger

func GetLogger(ctx context.Context) (l *logrus.Entry)

GetLogger retrieves the current logger from the context. If no logger is available, the default logger is returned.

func TraceLevelOnlyStack

func TraceLevelOnlyStack() string

TraceLevelOnlyStack returns a stack trace for the current goroutine only if trace level logs are enabled; otherwise it returns an empty string. This ensure we only pay the cost of generating a stack trace when the log entry will actually be emitted.

func WithLogger

func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context

WithLogger returns a new context with the provided logger. Use in combination with logger.WithField(s) for great effect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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