log

package
v0.0.0-...-41bf266 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetCtxLogger

func GetCtxLogger(ctx context.Context) logrus.FieldLogger

Gets the logrus.FieldLogger from a context

func NewStructuredLoggerEntry

func NewStructuredLoggerEntry(logger logrus.FieldLogger, ctx context.Context) context.Context

func SetCtxLogger

func SetCtxLogger(ctx context.Context, key string, value interface{}) (context.Context, logrus.FieldLogger)

Appends additional or creates new logrus.Fields to a logrus.FieldLogger within a context

Types

type CtxLoggerKeyType

type CtxLoggerKeyType string

type to create context.Context key

const CtxLoggerKey CtxLoggerKeyType = "ctxLogger"

context.Context key to set/get logrus.FieldLogger value within request context

type StructuredLoggerEntry

type StructuredLoggerEntry struct {
	Logger logrus.FieldLogger
}

func GetCtxEntry

func GetCtxEntry(ctx context.Context) *StructuredLoggerEntry

Gets the logrus.StructuredLoggerEntry from a context

func (*StructuredLoggerEntry) Panic

func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)

func (*StructuredLoggerEntry) Write

func (l *StructuredLoggerEntry) Write(status int, bytes int, header http.Header, elapsed time.Duration, extra interface{})

Jump to

Keyboard shortcuts

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