Documentation
¶
Index ¶
- Variables
- func Addr(addr string) zap.Field
- func Data(data []byte) zap.Field
- func Error(err error) zap.Field
- func Event(name string) zap.Field
- func Ip(ip string) zap.Field
- func Mid(mid string) zap.Field
- func TraceId(traceId string) zap.Field
- func UpdateAt(updatedAt int64) zap.Field
- func Uri(uri string) zap.Field
- func Value(value interface{}) zap.Field
- type Logger
- func (l *Logger) DPanic(msg string, fields ...zap.Field)
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Is(level zapcore.Level) bool
- func (l *Logger) Panic(msg string, fields ...zap.Field)
- func (l *Logger) Sync() error
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLevel = errors.New("invalid Level")
)
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) DPanic ¶
DPanic logs are particularly important errors. In development the logger panics after writing the message.
func (*Logger) Error ¶
Error logs are high-priority. If an application is running smoothly, it shouldn't generate any error-level logs.
type Option ¶
type Option struct {
// 日志级别:debug: -1 info:0 warn: 1 error: 2 dpanic: 3 panic: 4 fatal: 5
Level int8 `json:"level" yaml:"level"`
// 日志目录,默认路径:/tmp
Path string `json:"path" yaml:"path"`
// 定时检测文件时间间隔,单位秒,配置小于0的值表示禁用,默认5秒
TickSecond int32 `json:"tickSecond" yaml:"tickSecond"`
// contains filtered or unexported fields
}
func (*Option) WithEncoder ¶
func (*Option) WithFlagFunc ¶
Click to show internal directories.
Click to hide internal directories.