Help us shape the future of Go! Take the 2026 Go Developer Survey

bklog

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 72

Documentation

Index

Constants

This section is empty.

Variables

Functions

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 added in v0.13.0

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