zc

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 3 Imported by: 2

README

GoDoc

Simple utils for use zap logger with context.Context.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugDPanic added in v0.0.4

func DebugDPanic(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func DebugDPanicCtx added in v0.0.4

func DebugDPanicCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func DebugError added in v0.0.4

func DebugError(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func DebugErrorCtx added in v0.0.4

func DebugErrorCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func DebugFatal added in v0.0.4

func DebugFatal(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func DebugFatalCtx added in v0.0.4

func DebugFatalCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func DebugInfo added in v0.0.4

func DebugInfo(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func DebugInfoCtx added in v0.0.4

func DebugInfoCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func InfoDPanic added in v0.0.4

func InfoDPanic(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func InfoDPanicCtx added in v0.0.4

func InfoDPanicCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func InfoError added in v0.0.4

func InfoError(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func InfoErrorCtx added in v0.0.4

func InfoErrorCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func InfoFatal added in v0.0.4

func InfoFatal(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func InfoFatalCtx added in v0.0.4

func InfoFatalCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func InfoPanic added in v0.0.4

func InfoPanic(logger *zap.Logger, err error, msg string, fields ...zap.Field)

func InfoPanicCtx added in v0.0.4

func InfoPanicCtx(ctx context.Context, err error, msg string, fields ...zap.Field)

func L

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

Return associated logger. Default logger if no ctx logger yet. (default of default is nil)

func LNop

func LNop(ctx context.Context) (res *zap.Logger)

Return associated logger. Nop if no ctx logger yet.

func S

Return associated logger. Default logger if no ctx logger yet. (default of default is nil)

func SNop

func SNop(ctx context.Context) *zap.SugaredLogger

Return associated logger. Nop if no ctx logger yet.

func SetDefaultLogger added in v0.0.3

func SetDefaultLogger(logger *zap.Logger)

SetDefaultLogger set logger, which will return with L and S function if no logger in context. It is NOT thread safe and no syncronization with L and S

func WithLogger added in v0.0.2

func WithLogger(ctx context.Context, l *zap.Logger) context.Context

Return copy of ctx with associated logger

func WithSugarLogger added in v0.0.2

func WithSugarLogger(ctx context.Context, l *zap.SugaredLogger) context.Context

Return copy of ctx with associated logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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