log

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

filed可以用zap.Int()等创建

func Debugf

func Debugf(msg string, value ...any)

info 比上面的方法慢一倍,热点代码不建议用

func DevPanic

func DevPanic(msg string, fields ...zap.Field)

如果是开发模式,则抛出异常

func DevPanicf

func DevPanicf(msg string, fields ...any)

func Error

func Error(msg string, fields ...zap.Field)

error filed可以用zap.Int()等创建

func Errorf

func Errorf(msg string, fields ...any)

比上面的方法慢一倍,热点代码不建议用

func Info

func Info(msg string, fields ...zap.Field)

filed可以用zap.Int()等创建

func Infof

func Infof(msg string, value ...any)

比上面的方法慢一倍,热点代码不建议用

func InitLog

func InitLog(level zapcore.Level)

func InitWithConfig added in v0.0.5

func InitWithConfig(config LogConfig)

func NewLogger added in v0.0.9

func NewLogger(config LogConfig) *zap.Logger

func Panic

func Panic(msg string, fields ...zap.Field)

func Panicf

func Panicf(msg string, fields ...any)

func Sync added in v0.0.7

func Sync() error

func Warn

func Warn(msg string, fields ...zap.Field)

warn filed可以用zap.Int()等创建

func Warnf

func Warnf(msg string, fields ...any)

比上面的方法慢一倍,热点代码不建议用

Types

type LogConfig added in v0.0.5

type LogConfig struct {
	Sync          bool
	Path          string
	MergeErrorLog bool
	ErrPath       string
	Console       bool
	Level         zapcore.Level
	Dev           bool
}

type LogNormalLevel

type LogNormalLevel struct {
	Level         zapcore.Level
	MergeErrorLog bool
}

func (LogNormalLevel) Enabled

func (e LogNormalLevel) Enabled(lvl zapcore.Level) bool

Jump to

Keyboard shortcuts

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