Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func GetLevel() zapcore.Level
- func GetLevelStr() string
- func Info(msg string, fields ...zap.Field)
- func Level2String(level zapcore.Level) string
- func ParseLevel(level string) zapcore.Level
- func SetDefaultLogger(logger *Logger)
- func SetLogLevel(level zapcore.Level)
- func SetLogLevelStr(levelStr string)
- func Warn(msg string, fields ...zap.Field)
- type BoolArray
- type ByteStringsArray
- type Complex128Array
- type Complex64Array
- type DurationArray
- type Float32Array
- type Float64Array
- type Int16Array
- type Int32Array
- type Int64Array
- type Int8Array
- type IntArray
- type Logger
- func (z *Logger) Debug(msg string, fields ...zap.Field)
- func (z *Logger) Error(msg string, fields ...zap.Field)
- func (z *Logger) Info(msg string, fields ...zap.Field)
- func (z *Logger) Level() zapcore.Level
- func (z *Logger) LevelStr() string
- func (z *Logger) SetLevel(level zapcore.Level)
- func (z *Logger) SetLevelStr(sLevel string)
- func (z *Logger) Sync() error
- func (z *Logger) Warn(msg string, fields ...zap.Field)
- type StringArray
- type TimeArray
- type Uint16Array
- type Uint32Array
- type Uint64Array
- type Uint8Array
- type UintArray
- type ZapConf
- type Zaps
Constants ¶
View Source
const ( //level string DebugLevelStr = "debug" InfoLevelStr = "info" WarnLevelStr = "warn" ErrorLevelStr = "error" //level define DebugLevel = zap.DebugLevel InfoLevel = zap.InfoLevel WarnLevel = zap.WarnLevel ErrorLevel = zap.ErrorLevel )
Variables ¶
View Source
var ( //ErrZapEmpty empty zap logger ErrZapEmpty = errors.New("zap.pointer.empty") )
Functions ¶
Types ¶
type BoolArray ¶ added in v1.0.2
type BoolArray []bool
func (BoolArray) MarshalLogArray ¶ added in v1.0.2
func (bs BoolArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type ByteStringsArray ¶ added in v1.0.2
type ByteStringsArray [][]byte
func (ByteStringsArray) MarshalLogArray ¶ added in v1.0.2
func (bss ByteStringsArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Complex128Array ¶ added in v1.0.2
type Complex128Array []complex128
func (Complex128Array) MarshalLogArray ¶ added in v1.0.2
func (nums Complex128Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Complex64Array ¶ added in v1.0.2
type Complex64Array []complex64
func (Complex64Array) MarshalLogArray ¶ added in v1.0.2
func (nums Complex64Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type DurationArray ¶ added in v1.0.2
func (DurationArray) MarshalLogArray ¶ added in v1.0.2
func (ds DurationArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Float32Array ¶ added in v1.0.2
type Float32Array []float32
func (Float32Array) MarshalLogArray ¶ added in v1.0.2
func (nums Float32Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Float64Array ¶ added in v1.0.2
type Float64Array []float64
func (Float64Array) MarshalLogArray ¶ added in v1.0.2
func (nums Float64Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Int16Array ¶ added in v1.0.2
type Int16Array []int16
func (Int16Array) MarshalLogArray ¶ added in v1.0.2
func (nums Int16Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Int32Array ¶ added in v1.0.2
type Int32Array []int32
func (Int32Array) MarshalLogArray ¶ added in v1.0.2
func (nums Int32Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Int64Array ¶ added in v1.0.2
type Int64Array []int64
func (Int64Array) MarshalLogArray ¶ added in v1.0.2
func (nums Int64Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Int8Array ¶ added in v1.0.2
type Int8Array []int8
func (Int8Array) MarshalLogArray ¶ added in v1.0.2
func (nums Int8Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type IntArray ¶ added in v1.0.2
type IntArray []int
func (IntArray) MarshalLogArray ¶ added in v1.0.2
func (nums IntArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Logger ¶
Logger 封装可以动态设置log level的logger
func NewSimpleLogger ¶
NewSimpleLogger new zap logger without file log
func (*Logger) SetLevelStr ¶
SetLevelStr set level string
type StringArray ¶ added in v1.0.2
type StringArray []string
func (StringArray) MarshalLogArray ¶ added in v1.0.2
func (ss StringArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type TimeArray ¶ added in v1.0.2
func (TimeArray) MarshalLogArray ¶ added in v1.0.2
func (ts TimeArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Uint16Array ¶ added in v1.0.2
type Uint16Array []uint16
func (Uint16Array) MarshalLogArray ¶ added in v1.0.2
func (nums Uint16Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Uint32Array ¶ added in v1.0.2
type Uint32Array []uint32
func (Uint32Array) MarshalLogArray ¶ added in v1.0.2
func (nums Uint32Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Uint64Array ¶ added in v1.0.2
type Uint64Array []uint64
func (Uint64Array) MarshalLogArray ¶ added in v1.0.2
func (nums Uint64Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type Uint8Array ¶ added in v1.0.2
type Uint8Array []uint8
func (Uint8Array) MarshalLogArray ¶ added in v1.0.2
func (nums Uint8Array) MarshalLogArray(arr zapcore.ArrayEncoder) error
type UintArray ¶ added in v1.0.2
type UintArray []uint
func (UintArray) MarshalLogArray ¶ added in v1.0.2
func (nums UintArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
type ZapConf ¶
type ZapConf struct { //文件名 FileName string `json:"fileName" toml:"fileName"` //文件最大长度 (M bytes) MaxSize int `json:"maxSize" toml:"maxSize"` //文件最久天数 MaxAge int `json:"maxAge" toml:"maxAge"` //最大备份文件数量 MaxBackups int `json:"maxBackups" toml:"maxBackups"` //是否在备份文件格式中使用utc time,否则为local time UTCTime bool `json:"utcTime" toml:"utcTime"` //是否压缩旧的文件 Compress bool `json:"compress" toml:"compress"` //Disable log caller DisableCaller bool `json:"disableCaller" toml:"disableCaller"` //log level LogLevel string `json:"logLevel" toml:"logLevel"` }
ZapConf zap configuration
Click to show internal directories.
Click to hide internal directories.