Documentation ¶
Index ¶
- Constants
- func CnTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func Debug(c context.Context, args ...interface{})
- func Error(c context.Context, args ...interface{})
- func ErrorStack(c context.Context, args ...interface{})
- func Fatal(c context.Context, args ...interface{})
- func Info(c context.Context, args ...interface{})
- func Log(c context.Context, level zapcore.Level, args ...interface{})
- func LogLess() zapcore.Level
- func LogMore() zapcore.Level
- func Panic(c context.Context, args ...interface{})
- func Recover(c context.Context, errHandler func(interface{}) string)
- func SetDefaultGenerator(g DefaultFieldsGenerator)
- func SupplementFields(ctx context.Context) []zap.Field
- func Warn(c context.Context, args ...interface{})
- type DefaultFieldsGenerator
- type DefaultGenerator
Constants ¶
View Source
const ( LOG_TRADE_ID = "__GTraceId__" LOG_JSON_FIELD_TRACE_ID = "traceId" LOGGER_ENCODER_JSON = "json" LOGGER_ENCODER_CONSOLE = "console" )
Variables ¶
This section is empty.
Functions ¶
func CnTimeEncoder ¶
func CnTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
func ErrorStack ¶ added in v1.1.25
func SetDefaultGenerator ¶ added in v1.1.29
func SetDefaultGenerator(g DefaultFieldsGenerator)
Types ¶
type DefaultFieldsGenerator ¶ added in v1.1.29
DefaultFieldsGenerator 默认值入参
type DefaultGenerator ¶ added in v1.1.29
type DefaultGenerator struct { }
func (*DefaultGenerator) GetDefaultFields ¶ added in v1.1.29
func (f *DefaultGenerator) GetDefaultFields() []zap.Field
Click to show internal directories.
Click to hide internal directories.