Documentation ¶
Index ¶
- Variables
- func Addr(addr string) zap.Field
- func Any(key string, value interface{}) zap.Field
- func Args(args ...interface{}) zap.Field
- func Binary(key string, value []byte) zap.Field
- func Bool(key string, value bool) zap.Field
- func Bools(key string, value []bool) zap.Field
- func BytesString(key string, value []byte) zap.Field
- func BytesStrings(key string, value [][]byte) zap.Field
- func Cmd(cmd string) zap.Field
- func Data(data []byte) zap.Field
- func Duration(duration time.Duration) zap.Field
- func Error(err error) zap.Field
- func Event(name string) zap.Field
- func Id(id int64) zap.Field
- func Int(key string, value int) zap.Field
- func Int16(key string, value int16) zap.Field
- func Int16s(key string, value []int16) zap.Field
- func Int32(key string, value int32) zap.Field
- func Int32s(key string, value []int32) zap.Field
- func Int64(key string, value int64) zap.Field
- func Int64s(key string, value []int64) zap.Field
- func Int8(key string, value int8) zap.Field
- func Ints(key string, value []int) zap.Field
- func Ip(ip string) zap.Field
- func Key(key string) zap.Field
- func Method(method string) zap.Field
- func Mid(mid string) zap.Field
- func Offset(oft string) zap.Field
- func Params(params ...interface{}) zap.Field
- func Path(path string) zap.Field
- func Size(size int64) zap.Field
- func String(key, value string) zap.Field
- func Strings(key string, value []string) zap.Field
- func Time(key string, value time.Time) zap.Field
- func Times(key string, value []time.Time) zap.Field
- func TraceId(traceId string) zap.Field
- func Uint(key string, value uint) zap.Field
- func Uint16(key string, value uint16) zap.Field
- func Uint16s(key string, value []uint16) zap.Field
- func Uint32(key string, value uint32) zap.Field
- func Uint32s(key string, value []uint32) zap.Field
- func Uint64(key string, value uint64) zap.Field
- func Uint64s(key string, value []uint64) zap.Field
- func Uint8(key string, value uint8) zap.Field
- func Uint8s(key string, value []uint8) zap.Field
- func Uints(key string, value []uint) 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.