libzap

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(basePath string, accessLogLevel Level) *zap.Logger

func NewStdout added in v0.2.3

func NewStdout(accessLogLevel Level) *zap.Logger

func NewTeeWithRotate

func NewTeeWithRotate(teeOptions []TeeOption, zapOptions ...zap.Option) *zap.Logger

Types

type Level

type Level = zapcore.Level
const (
	DebugLevel  Level = zap.DebugLevel  // -1
	InfoLevel   Level = zap.InfoLevel   // 0, default level
	WarnLevel   Level = zap.WarnLevel   // 1
	ErrorLevel  Level = zap.ErrorLevel  // 2
	DPanicLevel Level = zap.DPanicLevel // 3, used in development log
	// PanicLevel logs a message, then panics.
	PanicLevel Level = zap.PanicLevel // 4
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel Level = zap.FatalLevel // 5
)

type LevelEnablerFunc

type LevelEnablerFunc func(level Level) bool

type RotateOptions

type RotateOptions struct {
	MaxSize    int
	MaxAge     int
	MaxBackups int
	Compress   bool
}

type TeeOption

type TeeOption struct {
	Filename         string
	Rotate           RotateOptions
	LevelEnablerFunc LevelEnablerFunc
}

Jump to

Keyboard shortcuts

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