Documentation ¶
Index ¶
- Constants
- func AddError(errs ...error) zap.Field
- func Any(key string, value interface{}) zap.Field
- func Array(key string, val zapcore.ArrayMarshaler) zap.Field
- func Binary(key string, val []byte) zap.Field
- func Bool(key string, val bool) zap.Field
- func Bools(key string, bs []bool) zap.Field
- func ByteString(key string, val []byte) zap.Field
- func ByteStrings(key string, bss [][]byte) zap.Field
- func Complex128(key string, val complex128) zap.Field
- func Complex128s(key string, nums []complex128) zap.Field
- func Complex64(key string, val complex64) zap.Field
- func Complex64s(key string, nums []complex64) zap.Field
- func DPanic(msg string, start int64, fields ...zap.Field)
- func Debug(msg string, start int64, fields ...zap.Field)
- func Duration(key string, val time.Duration) zap.Field
- func Durations(key string, ds []time.Duration) zap.Field
- func Error(msg string, start int64, fields ...zap.Field)
- func Errors(key string, errs ...error) zap.Field
- func Fatal(msg string, start int64, fields ...zap.Field)
- func Float32(key string, val float32) zap.Field
- func Float32s(key string, nums []float32) zap.Field
- func Float64(key string, val float64) zap.Field
- func Float64s(key string, nums []float64) zap.Field
- func GetLevel(str string) zapcore.Level
- func Info(msg string, start int64, fields ...zap.Field)
- func InitDefaultLog(config *ZapConfig) *zap.Logger
- func InitNewLog(config *ZapConfig) *zap.Logger
- func Int(key string, val int) zap.Field
- func Int16(key string, val int16) zap.Field
- func Int16s(key string, nums []int16) zap.Field
- func Int32(key string, val int32) zap.Field
- func Int32s(key string, nums []int32) zap.Field
- func Int64(key string, val int64) zap.Field
- func Int64s(key string, nums []int64) zap.Field
- func Int8(key string, val int8) zap.Field
- func Int8s(key string, nums []int8) zap.Field
- func Ints(key string, nums []int) zap.Field
- func IsDebug() bool
- func Namespace(key string) zap.Field
- func Object(key string, val zapcore.ObjectMarshaler) zap.Field
- func Panic(msg string, start int64, fields ...zap.Field)
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func Reflect(key string, val interface{}) zap.Field
- func Skip() zap.Field
- func Stack(key string) zap.Field
- func String(key string, val string) zap.Field
- func Stringer(key string, val fmt.Stringer) zap.Field
- func Strings(key string, ss []string) zap.Field
- func Time(key string, val time.Time) zap.Field
- func Times(key string, ts []time.Time) zap.Field
- func Uint(key string, val uint) zap.Field
- func Uint16(key string, val uint16) zap.Field
- func Uint16s(key string, nums []uint16) zap.Field
- func Uint32(key string, val uint32) zap.Field
- func Uint32s(key string, nums []uint32) zap.Field
- func Uint64(key string, val uint64) zap.Field
- func Uint64s(key string, nums []uint64) zap.Field
- func Uint8(key string, val uint8) zap.Field
- func Uint8s(key string, nums []uint8) zap.Field
- func Uintptr(key string, val uintptr) zap.Field
- func Uintptrs(key string, us []uintptr) zap.Field
- func Uints(key string, nums []uint) zap.Field
- func Warn(msg string, start int64, fields ...zap.Field)
- type FileConfig
- type ZapConfig
- type ZapLog
- type ZapProducer
Constants ¶
View Source
const ( DEBUG = "debug" INFO = "info" WARN = "warn" ERROR = "error" FATAL = "fatal" )
Variables ¶
This section is empty.
Functions ¶
func Complex128 ¶
func Complex128(key string, val complex128) zap.Field
func Complex128s ¶
func Complex128s(key string, nums []complex128) zap.Field
Types ¶
type FileConfig ¶
type FileConfig struct { Filename string // 日志文件路径 MaxSize int // 每个日志文件保存的最大尺寸 单位:M MaxBackups int // 日志文件最多保存多少个备份 MaxAge int // 文件最多保存多少天 Compress bool // 是否压缩 }
日志文件输出配置
type ZapConfig ¶
type ZapConfig struct { Level string // 日志级别 Console bool // 是否控制台输出 FileConfig *FileConfig // 输出文件配置 Callfunc func([]byte) error // 回调函数 }
日志初始化配置
type ZapProducer ¶
第三方发送对象实现
Click to show internal directories.
Click to hide internal directories.