zap

package module
v0.20.8 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...logger.Option) (*zaplog, error)

New builds a new logger based on options

func WithCallerSkip

func WithCallerSkip(i int) logger.Option

func WithConfig

func WithConfig(c zap.Config) logger.Option

WithConfig pass zap.Config to logger

func WithEncoderConfig

func WithEncoderConfig(c zapcore.EncoderConfig) logger.Option

WithEncoderConfig pass zapcore.EncoderConfig to logger

func WithFileWriter

func WithFileWriter(fw FileWriter) logger.Option

func WithJSONEncode

func WithJSONEncode() logger.Option

func WithNamespace

func WithNamespace(namespace string) logger.Option

func WithWriter

func WithWriter(writer zapcore.WriteSyncer) logger.Option

Types

type FileWriter

type FileWriter struct {
	FileName   string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Compress   bool
}

Jump to

Keyboard shortcuts

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