Documentation ¶
Index ¶
- Constants
- Variables
- func DPanic(args ...interface{})
- func DPanicd(msg string, fields ...Field)
- func DPanicf(template string, args ...interface{})
- func DPanicw(msg string, keysAndValues ...interface{})
- func Debug(args ...interface{})
- func Debugd(msg string, fields ...Field)
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errord(msg string, fields ...Field)
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func FieldAid(aid string) zap.Field
- func FieldAny(key string, val interface{}) zap.Field
- func FieldCode(code interface{}) zap.Field
- func FieldErr(err error) zap.Field
- func FieldHost(host string) zap.Field
- func FieldIp(ip string) zap.Field
- func FieldMod(mod string) zap.Field
- func FieldString(key, val string) zap.Field
- func FieldTid(tid string) zap.Field
- func FieldValue(value interface{}) zap.Field
- func Info(args ...interface{})
- func Infod(msg string, fields ...Field)
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Panic(args ...interface{})
- func Panicd(msg string, fields ...Field)
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func Warn(args ...interface{})
- func Warnd(msg string, fields ...Field)
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Config
- type Field
- type Func
- type Interface
- type Level
- type Logger
- func (l *Logger) AddCallerSkip(i int) *Logger
- func (l *Logger) AutoLevel(key string)
- func (l *Logger) DPanic(args ...interface{})
- func (l *Logger) DPanicd(msg string, fields ...Field)
- func (l *Logger) DPanicf(template string, args ...interface{})
- func (l *Logger) DPanicw(msg string, keysAndValues ...interface{})
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugd(msg string, fields ...Field)
- func (l *Logger) Debugf(template string, args ...interface{})
- func (l *Logger) Debugw(msg string, keysAndValues ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errord(msg string, fields ...Field)
- func (l *Logger) Errorf(template string, args ...interface{})
- func (l *Logger) Errorw(msg string, keysAndValues ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infod(msg string, fields ...Field)
- func (l *Logger) Infof(template string, args ...interface{})
- func (l *Logger) Infow(msg string, keysAndValues ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicd(msg string, fields ...Field)
- func (l *Logger) Panicf(template string, args ...interface{})
- func (l *Logger) Panicw(msg string, keysAndValues ...interface{})
- func (l *Logger) SetLevel(level Level) *Logger
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnd(msg string, fields ...Field)
- func (l *Logger) Warnf(template string, args ...interface{})
- func (l *Logger) Warnw(msg string, keysAndValues ...interface{})
- func (l *Logger) With(fields ...Field) *Logger
- func (l *Logger) ZapLogger() *zap.Logger
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = zap.DebugLevel // InfoLevel is the default logging priority. InfoLevel = zap.InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = zap.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-Level logs. ErrorLevel = zap.ErrorLevel // PanicLevel logs a message, then panics. PanicLevel = zap.PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zap.FatalLevel )
Variables ¶
View Source
var ( // String ... String = zap.String // Any ... Any = zap.Any // Int64 ... Int64 = zap.Int64 // Int ... Int = zap.Int // Int32 ... Int32 = zap.Int32 // Uint ... Uint = zap.Uint // Duration ... Duration = zap.Duration // Durationp ... Durationp = zap.Durationp // Object ... Object = zap.Object // Namespace ... Namespace = zap.Namespace // Reflect ... Reflect = zap.Reflect // Skip ... Skip = zap.Skip() // ByteString ... ByteString = zap.ByteString )
Functions ¶
Types ¶
type Config ¶
type Config struct { Debug bool `json:"debug"` // 是否开启debug模式,默认false Stdout bool `json:"stdout"` // 终端输出日志 Level string `json:"level"` // 日志等级 Fields []zap.Field `json:"fields"` // 初始化字段 AddCaller bool `json:"add_caller"` // 是否打印调用者信息,默认,true TimeFormat string `json:"time_format"` // 时间格式化 CallerSkip int `json:"caller_skip"` // 表示输出当前栈帧,默认,1 Core zapcore.Core EncoderConfig *zapcore.EncoderConfig `json:"encoder_config"` // 日志编码设置 Writers map[string]interface{} `json:"writers"` // 配置信息 // contains filtered or unexported fields }
type Interface ¶
type Interface interface { // Sugar Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) DPanic(args ...interface{}) Panic(args ...interface{}) // Sugar f Debugf(template string, args ...interface{}) Infof(template string, args ...interface{}) Warnf(template string, args ...interface{}) Errorf(template string, args ...interface{}) DPanicf(template string, args ...interface{}) Panicf(template string, args ...interface{}) }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
bufferpool
Package bufferpool houses zap's shared internal buffer pool.
|
Package bufferpool houses zap's shared internal buffer pool. |
Click to show internal directories.
Click to hide internal directories.