libzap

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(writer io.Writer, level Level, opts ...zap.Option) *zap.Logger

New create a new logs (not support log rotating).

func NewDefaultLogger

func NewDefaultLogger() *zap.Logger

func NewTeeWithRotate

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

Types

type Level

type Level = zapcore.Level
const (
	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
	DebugLevel Level = zap.DebugLevel // -1
)

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