logger

package
v0.0.0-...-c3677c5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetLogger

func GetLogger(ctx context.Context) logrus.FieldLogger

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

func ShouldJSON

func ShouldJSON(ctx context.Context, o interface{}) string

ShouldJSON returns JSON'd version of object, and if it cannot, it will log the error, and returns the "%+v" formatted version

func WithField

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

func WithFields

func WithFields(ctx context.Context, fields map[string]interface{}) context.Context

func WithLogger

func WithLogger(ctx context.Context, logger logrus.FieldLogger) 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