logger

package
v0.0.0-...-125c38c Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field = zap.Field

type Level

type Level = zapcore.Level

type LevelEnablerFunc

type LevelEnablerFunc func(lvl Level) bool

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewTee

func NewTee(tops []TeeOption, opts ...Option) *Logger

func NewTeeWithRotate

func NewTeeWithRotate(tops []TeeRotateOption, opts ...Option) *Logger

func (*Logger) DPanic

func (l *Logger) DPanic(msg string, fields ...Field)

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...Field)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...Field)

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

func (*Logger) Panic

func (l *Logger) Panic(msg string, fields ...Field)

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...Field)

type Option

type Option = zap.Option

type RotateOption

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

type TeeOption

type TeeOption struct {
	W   io.Writer
	Lef LevelEnablerFunc
}

type TeeRotateOption

type TeeRotateOption struct {
	Filename string
	Rop      RotateOption
	Lef      LevelEnablerFunc
}

Jump to

Keyboard shortcuts

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