Documentation
¶
Index ¶
- Variables
- func Debug(msg string, fields ...zap.Field)
- func Debugf(msg string, value ...any)
- func DevPanic(msg string, fields ...zap.Field)
- func DevPanicf(msg string, fields ...any)
- func Error(msg string, fields ...zap.Field)
- func Errorf(msg string, fields ...any)
- func If[T any](condition bool, trueVal, falseVal T) T
- func Info(msg string, fields ...zap.Field)
- func Infof(msg string, value ...any)
- func InitLog(level string) error
- func InitWithConfig(config LogConfig) error
- func NewLogger(config LogConfig) (*zap.Logger, error)deprecated
- func NewZapLogger(config LogConfig) (*zap.Logger, error)
- func Panic(msg string, fields ...zap.Field)
- func Panicf(msg string, fields ...any)
- func Sync() error
- func Warn(msg string, fields ...zap.Field)
- func Warnf(msg string, fields ...any)
- type LogConfig
- type LogNormalLevel
- type Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Current zlog Normal Logger )
Functions ¶
func InitWithConfig ¶ added in v0.0.5
func NewZapLogger ¶ added in v0.2.20
new zap logger
Types ¶
type LogConfig ¶ added in v0.0.5
type LogConfig struct { Sync bool `json:"sync" yaml:"sync"` // 启用同步模式 Path string `json:"path" yaml:"path"` // 日志输出路径 MergeError bool `json:"mergeErr" yaml:"mergeErr"` // 合并错误日志到常规日志 ErrPath string `json:"errPath" yaml:"errPath"` // 错误日志输出路径 Console bool `json:"console" yaml:"console"` // 输出到控制台 NotToFile bool `json:"file" yaml:"file"` // 输出到文件 Level string `json:"level" yaml:"level"` // 日志级别 Dev bool `json:"dev" yaml:"dev"` // 开发模式 Caller bool `json:"caller" yaml:"caller"` // 输出调用者信息 CallerSkip int `json:"callerSkip" yaml:"callerSkip"` // 跳过调用者代码层级(适用于封装层) // contains filtered or unexported fields }
type LogNormalLevel ¶
Click to show internal directories.
Click to hide internal directories.