Documentation
¶
Index ¶
- Variables
- func ConfigEntry(name string) string
- func DebugEncodeLevel(lv zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func Default() *zap.Logger
- func DefaultZapConfig() *zapcore.EncoderConfig
- func GetTraceID(ctx context.Context) string
- func Jupiter() *zap.Logger
- func NewContext(ctx context.Context, l *Logger) context.Context
- func SetTraceID(ctx context.Context, traceID string) context.Context
- type Config
- type Field
- func FieldAddr(value string) Field
- func FieldAddrAny(value interface{}) Field
- func FieldAid(value string) Field
- func FieldCode(value int32) Field
- func FieldCost(value time.Duration) Field
- func FieldErr(err error) Field
- func FieldErrKind(value string) Field
- func FieldEvent(value string) Field
- func FieldExtMessage(vals ...interface{}) Field
- func FieldKey(value string) Field
- func FieldKeyAny(value interface{}) Field
- func FieldMethod(value string) Field
- func FieldMod(value string) Field
- func FieldName(value string) Field
- func FieldStack(value []byte) Field
- func FieldStringErr(err string) Field
- func FieldType(value string) Field
- func FieldValue(value string) Field
- func FieldValueAny(value interface{}) Field
- type Level
- type Logger
Constants ¶
This section is empty.
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 )
View Source
var ConfigPrefix = constant.ConfigPrefix + ".logger"
Functions ¶
func ConfigEntry ¶ added in v0.3.1
func DebugEncodeLevel ¶
func DebugEncodeLevel(lv zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
DebugEncodeLevel ...
func GetTraceID ¶ added in v0.4.3
Types ¶
type Config ¶
type Config struct {
// Dir 日志输出目录
Dir string
// Name 日志文件名称
Name string
// Level 日志初始等级
Level string
// 日志初始化字段
Fields []zap.Field
// 是否添加调用者信息
AddCaller bool
// 日志前缀
Prefix string
// 日志输出文件最大长度,超过改值则截断
MaxSize int
MaxAge int
MaxBackup int
// 日志磁盘刷盘间隔
Interval time.Duration
CallerSkip int
Async bool
Queue bool
QueueSleep time.Duration
Core zapcore.Core
Debug bool
EncoderConfig *zapcore.EncoderConfig
// contains filtered or unexported fields
}
Config ...
Click to show internal directories.
Click to hide internal directories.