svc1zap

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger svc1log.Logger, opts ...Option) *zap.Logger

New returns a zap logger that delegates to the provided svc1log logger. The enabled/disabled log level configuration on the returned zap logger is ignored in favor of the svc1log configuration.

func NewCore

func NewCore(logger svc1log.Logger, opts ...Option) zapcore.Core

Types

type Option

type Option func(*svc1zapCore)

func WithEntryMutatorFunc added in v1.22.0

func WithEntryMutatorFunc(mutator func(entry zapcore.Entry) (out zapcore.Entry, ok bool)) Option

WithEntryMutatorFunc provides a function for modifying or skipping entries dynamically. If mutator is set, ok must return true for the message to be logged.

func WithNewParamFunc

func WithNewParamFunc(newParam func(key string, value interface{}) svc1log.Param) Option

WithNewParamFunc provides a function for constructing svc1log.Param values from zap fields. Use this option to control parameter safety. By default, all fields are converted to unsafe params. If newParam returns nil, the field is skipped.

func WithOriginFromZapCaller

func WithOriginFromZapCaller() Option

WithOriginFromZapCaller enables zap.AddCaller() and uses the caller file and line to construct the origin value. Similar to svc1log.OriginFromCallLine().

Jump to

Keyboard shortcuts

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