zap

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.0.13

func New(loggerName string, opts ...Option) (*zap.Logger, error)

func NewLogger

func NewLogger(loggerName string, opts ...Option) (logr.Logger, error)

func NewLoggerWithContext

func NewLoggerWithContext(ctx context.Context, loggerName string, opts ...Option) (context.Context, logr.Logger, error)

Types

type Option

type Option func(*zap.Config)

func WithErrorOutputPaths added in v0.0.7

func WithErrorOutputPaths(paths []string) Option

WithErrorOutputPaths sets error paths.

e.g. stderr, /tmp/error.log

func WithInitialFields

func WithInitialFields(fields map[string]interface{}) Option

func WithLevel added in v0.0.8

func WithLevel(lvl zapcore.Level) Option

WithLevel sets log level.

func WithOutputPaths added in v0.0.7

func WithOutputPaths(paths []string) Option

WithOutputPaths sets output paths.

e.g. stdout, /tmp/output.log

Jump to

Keyboard shortcuts

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