Documentation
¶
Index ¶
- Constants
- func CnTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func ContextWithTraceId() context.Context
- func ContextWithTraceIdFromParent(parent context.Context) context.Context
- 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 GetLogLevel() zapcore.Level
- 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 NewTraceId() string
- func Panic(c context.Context, args ...interface{})
- func Recover(c context.Context, errHandler func(interface{}) string)
- func SetDefaultGenerator(g DefaultFieldsGenerator)
- func SetLogLevel(l zapcore.Level) zapcore.Level
- func SupplementFields(ctx context.Context) []zap.Field
- func Warn(c context.Context, args ...interface{})
- type DefaultFieldsGenerator
- type DefaultGenerator
Constants ¶
View Source
const ( LOG_TRACE_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 ContextWithTraceId ¶ added in v1.3.5
func ContextWithTraceIdFromParent ¶ added in v1.3.5
func ErrorStack ¶ added in v1.1.25
func GetLogLevel ¶ added in v1.3.5
func NewTraceId ¶ added in v1.3.5
func NewTraceId() string
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.