bklog

package
v0.12.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EnableLogWithTraceID added in v0.10.0

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 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

type LazyStackTrace added in v0.12.0

type LazyStackTrace struct{}

LazyStackTrace lets you include a stack trace as a field's value in a log but only call it when the log level is actually enabled.

func (LazyStackTrace) MarshalText added in v0.12.0

func (LazyStackTrace) MarshalText() ([]byte, error)

func (LazyStackTrace) String added in v0.12.0

func (LazyStackTrace) String() string

Jump to

Keyboard shortcuts

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