Documentation ¶
Index ¶
- Constants
- func GetEncoder() zapcore.Encoder
- func InitLogger(file string, level zapcore.Level)
- func JudgeLogLevel(debug bool) zapcore.Level
- func LogDebug(msg ...any)
- func LogError(msg ...any)
- func LogFatal(msg ...any)
- func LogInfo(msg ...any)
- func LogWarn(msg ...any)
- func NewLogWriter(file string) zapcore.WriteSyncer
- func SingleZapLogger() *zap.Logger
- func SingleZapWriter() zapcore.WriteSyncer
- type Logger
- type VegeLog
- func (l *VegeLog) Debug(msg ...any)
- func (l *VegeLog) Error(msg ...any)
- func (l *VegeLog) Fatal(msg ...any)
- func (l *VegeLog) GetZapLogger() *zap.Logger
- func (l *VegeLog) GetZapWriter() zapcore.WriteSyncer
- func (l *VegeLog) Info(msg ...any)
- func (l *VegeLog) Printf(format string, v ...any)
- func (l *VegeLog) Warn(msg ...any)
Constants ¶
View Source
const ISO8601 = "2006-01-02T15:04:05.000Z0700"
Variables ¶
This section is empty.
Functions ¶
func GetEncoder ¶ added in v1.1.3
func InitLogger ¶
InitLogger 初始化logger记录日志的文件 level 通常使用 zapcore.DebugLevel / zapcore.InfoLevel
func JudgeLogLevel ¶
debug mode:Info模式false,Debug模式true
func NewLogWriter ¶ added in v1.1.3
func NewLogWriter(file string) zapcore.WriteSyncer
创建日志写入的zapcore.WriteSyncer,实现了io.Writer
Types ¶
type Logger ¶ added in v1.1.3
type Logger interface { Printf(format string, v ...any) Debug(msg ...any) Info(msg ...any) Warn(msg ...any) Error(msg ...any) Fatal(msg ...any) }
func SingleVegeLogger ¶ added in v1.1.6
func SingleVegeLogger() Logger
type VegeLog ¶ added in v1.1.3
type VegeLog struct { *zap.Logger zapcore.WriteSyncer }
func (*VegeLog) GetZapLogger ¶ added in v1.1.3
func (*VegeLog) GetZapWriter ¶ added in v1.1.6
func (l *VegeLog) GetZapWriter() zapcore.WriteSyncer
Click to show internal directories.
Click to hide internal directories.