Documentation ¶
Index ¶
- func AddRequestID(ctx context.Context, logger *zap.Logger) *zap.Logger
- func ContextValue(ctx context.Context, fallbacks ...*zap.Logger) *zap.Logger
- func ContextWithValue(ctx context.Context, logger *zap.Logger) context.Context
- func Debug(opt *options.LogOpt) (*zap.Logger, error)
- func DebugBufferedLogger(out *rr) *debugBufferingLogger
- func Default() *zap.Logger
- func Init()
- func LogParamError(name string, r *http.Request, err error)
- func Make(opt *options.LogOpt) (logger *zap.Logger, err error)
- func MakeDebugLogger() *zap.Logger
- func Mask(key string, val interface{}) zap.Field
- func MaskIf(key string, val interface{}, mask bool) zap.Field
- func Must(logger *zap.Logger, err error) *zap.Logger
- func Production(opt *options.LogOpt) (*zap.Logger, error)
- func SetDefault(logger *zap.Logger)
- func Uint64(k string, id uint64) zap.Field
- func Uint64s(k string, id []uint64) zap.Field
- func WriteLogBuffer(w io.Writer, after, limit int) (_ int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRequestID ¶
AddRequestID sets requestID field from context to logger and returns it
func ContextValue ¶
ContextValue retrieves logger from given context or falls back to any of the logger passed to it. If no loggers are found it uses default logger from pkg/logger
func ContextWithValue ¶
ContextWithValue allows us to pack custom logger to context and pass that to the
func DebugBufferedLogger ¶
func DebugBufferedLogger(out *rr) *debugBufferingLogger
DebugBufferedLogger provides buffered logger compatible with zap.
func Init ¶
func Init()
Init (re)initializes global logger according to the settings
It also peaks into http-server options to determinate if log events should be buffered for use from web console
func LogParamError ¶
LogParamError for loggin invalid params
func MaskIf ¶
MaskIf conditionally masks (replaces string with * of equal length input string/stringer
func SetDefault ¶
Types ¶
This section is empty.