log

package
v0.0.0-...-6ffc9e3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WithCaller    = zap.WithCaller
	AddStacktrace = zap.AddStacktrace
	AddCallerSkip = zap.AddCallerSkip
)
View Source
var (
	Skip        = zap.Skip
	Binary      = zap.Binary
	Bool        = zap.Bool
	Boolp       = zap.Boolp
	ByteString  = zap.ByteString
	Complex128  = zap.Complex128
	Complex128p = zap.Complex128p
	Complex64   = zap.Complex64
	Complex64p  = zap.Complex64p
	Float64     = zap.Float64
	Float64p    = zap.Float64p
	Float32     = zap.Float32
	Float32p    = zap.Float32p
	Int         = zap.Int
	Intp        = zap.Intp
	Int64       = zap.Int64
	Int64p      = zap.Int64p
	Int32       = zap.Int32
	Int32p      = zap.Int32p
	Int16       = zap.Int16
	Int16p      = zap.Int16p
	Int8        = zap.Int8
	Int8p       = zap.Int8p
	String      = zap.String
	Stringp     = zap.Stringp
	Uint        = zap.Uint
	Uintp       = zap.Uintp
	Uint64      = zap.Uint64
	Uint64p     = zap.Uint64p
	Uint32      = zap.Uint32
	Uint32p     = zap.Uint32p
	Uint16      = zap.Uint16
	Uint16p     = zap.Uint16p
	Uint8       = zap.Uint8
	Uint8p      = zap.Uint8p
	Uintptr     = zap.Uintptr
	Uintptrp    = zap.Uintptrp
	Reflect     = zap.Reflect
	Namespace   = zap.Namespace
	Stringer    = zap.Stringer
	Time        = zap.Time
	Timep       = zap.Timep
	Stack       = zap.Stack
	StackSkip   = zap.StackSkip
	Duration    = zap.Duration
	Durationp   = zap.Durationp
	Any         = zap.Any
)
View Source
var (
	Info   = std.Info
	Warn   = std.Warn
	Error  = std.Error
	DPanic = std.DPanic
	Panic  = std.Panic
	Fatal  = std.Fatal
	Debug  = std.Debug
)

Functions

func ResetDefault

func ResetDefault(l *Logger)

not safe for concurrent use

func Sync

func Sync() error

Types

type Field

type Field = zap.Field

function variables for all field types in github.com/uber-go/zap/field.go

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(lvl Level) bool

type Logger

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

func Default

func Default() *Logger

func NewFileLoger

func NewFileLoger(logpath string, level Level, opts ...Option) *Logger

func NewLogger

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

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

func NewLoggerTeeWithRotate

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

func (*Logger) DPanic

func (l *Logger) DPanic(fmt string, args ...interface{})

func (*Logger) Debug

func (l *Logger) Debug(fmt string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(fmt string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(fmt string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(fmt string, args ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(fmt string, args ...interface{})

func (*Logger) Sync

func (l *Logger) Sync() error

func (*Logger) Warn

func (l *Logger) Warn(fmt string, args ...interface{})

func (*Logger) With

func (l *Logger) With(args ...interface{}) *Logger

type Option

type Option = zap.Option

type RotateOptions

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

type TeeOption

type TeeOption struct {
	Filename string
	Ropt     RotateOptions
	Lef      LevelEnablerFunc
}

Jump to

Keyboard shortcuts

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