Back to

Package logger

Latest Go to latest

The highest tagged major version is .

Published: Sep 13, 2020 | License: Apache-2.0 | Module:



var (
	DefaultLevel = zap.NewAtomicLevel()

func AddRequestID

func AddRequestID(ctx context.Context, log *zap.Logger) *zap.Logger

NamedDefault returns default logger with requestID (from context) and extended name

func ContextValue

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

func ContextWithValue

func ContextWithValue(ctx context.Context, log *zap.Logger) context.Context

func Default

func Default() *zap.Logger

func Init

func Init()

func LogControllerCall

func LogControllerCall(name string, r *http.Request, params interface{})

LogRequest logs REST controller call and HTTP request

Each log entry has it's own set of fields

func LogControllerError

func LogControllerError(name string, r *http.Request, err error, params interface{})

LogControllerError for logging errors inside REST controllers

func LogParamError

func LogParamError(name string, r *http.Request, err error)

LogParamError for loggin invalid params

func MakeDebugLogger

func MakeDebugLogger() *zap.Logger

func Mask

func Mask(key string, val interface{}) zap.Field

Mask is a passthrough for MaskIf

func MaskIf

func MaskIf(key string, val interface{}, mask bool) zap.Field

MaskIf conditionally masks (replaces string with * of equal length input string/stringer

func SetDefault

func SetDefault(logger *zap.Logger)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier