ctxzap

package module
v0.0.0-...-66cf837 Latest Latest
Warning

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

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

README

ctxzap

a ctxlogger that is backed by Zap

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFields

func AddFields(ctx context.Context, fields ...zapcore.Field)

AddFields adds zap fields to the logger.

func Debug

func Debug(ctx context.Context, msg string, fields ...zap.Field)

Debug is equivalent to calling Debug on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.

func Error

func Error(ctx context.Context, msg string, fields ...zap.Field)

Error is equivalent to calling Error on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.

func Extract

func Extract(ctx context.Context) *zap.Logger

Extract takes the call-scoped Logger from the context.

func Info

func Info(ctx context.Context, msg string, fields ...zap.Field)

Info is equivalent to calling Info on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.

func ToContext

func ToContext(ctx context.Context, logger *zap.Logger) context.Context

ToContext adds the zap.Logger to the context for extraction later. Returning the new context that has been created.

func Warn

func Warn(ctx context.Context, msg string, fields ...zap.Field)

Warn is equivalent to calling Warn on the zap.Logger in the context. It is a no-op if the context does not contain a zap.Logger.

Types

This section is empty.

Jump to

Keyboard shortcuts

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