bklog

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 70

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