ctxlog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextFields

func ContextFields(ctx context.Context) []log.Field

ContextFields returns log.Fields bound with ctx. If no fields are bound, it returns nil.

func Debug

func Debug(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Debug logs at Debug log level using fields both from arguments and ones that are bound to ctx.

func Debugf

func Debugf(ctx context.Context, l log.Logger, format string, args ...interface{})

Debugf logs at Debug log level using fields that are bound to ctx. The message is formatted using provided arguments.

func Error

func Error(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Error logs at Error log level using fields both from arguments and ones that are bound to ctx.

func Errorf

func Errorf(ctx context.Context, l log.Logger, format string, args ...interface{})

Errorf logs at Error log level using fields that are bound to ctx. The message is formatted using provided arguments.

func Fatal

func Fatal(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Fatal logs at Fatal log level using fields both from arguments and ones that are bound to ctx.

func Fatalf

func Fatalf(ctx context.Context, l log.Logger, format string, args ...interface{})

Fatalf logs at Fatal log level using fields that are bound to ctx. The message is formatted using provided arguments.

func Info

func Info(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Info logs at Info log level using fields both from arguments and ones that are bound to ctx.

func Infof

func Infof(ctx context.Context, l log.Logger, format string, args ...interface{})

Infof logs at Info log level using fields that are bound to ctx. The message is formatted using provided arguments.

func Trace

func Trace(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Trace logs at Trace log level using fields both from arguments and ones that are bound to ctx.

func Tracef

func Tracef(ctx context.Context, l log.Logger, format string, args ...interface{})

Tracef logs at Trace log level using fields that are bound to ctx. The message is formatted using provided arguments.

func Warn

func Warn(ctx context.Context, l log.Logger, msg string, fields ...log.Field)

Warn logs at Warn log level using fields both from arguments and ones that are bound to ctx.

func Warnf

func Warnf(ctx context.Context, l log.Logger, format string, args ...interface{})

Warnf logs at Warn log level using fields that are bound to ctx. The message is formatted using provided arguments.

func WithFields

func WithFields(ctx context.Context, fields ...log.Field) context.Context

WithFields returns a new context that is bound with given fields and based on parent ctx.

Types

This section is empty.

Jump to

Keyboard shortcuts

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