Documentation ¶
Index ¶
- Constants
- func Debug(msg string, fields ...zap.Field)
- func Error(msg string, fields ...zap.Field)
- func Info(msg string, fields ...zap.Field)
- func WithDebug(ctx *context.Context, msg string, fields ...zap.Field)
- func WithError(ctx *context.Context, msg string, fields ...zap.Field)
- func WithInfo(ctx *context.Context, msg string, fields ...zap.Field)
- type FormatTemplateWithor
- type GLogger
- func (log GLogger) Debug(msg string, fields ...zap.Field)
- func (log GLogger) Error(msg string, fields ...zap.Field)
- func (log GLogger) Errorf(msg string, args ...interface{})
- func (log GLogger) Info(msg string, fields ...zap.Field)
- func (log GLogger) Infof(msg string, args ...interface{})
- func (log GLogger) SetContext(ctx *context.Context) GLogger
- func (log GLogger) Warnf(msg string, args ...interface{})
- func (log GLogger) With(fields ...zap.Field) GLogger
- func (log GLogger) WithDebug(ctx *context.Context, msg string, fields ...zap.Field)
- func (log GLogger) WithError(ctx *context.Context, msg string, fields ...zap.Field)
- func (log GLogger) WithErrorf(ctx *context.Context, msg string, args ...interface{})
- func (log GLogger) WithInfo(ctx *context.Context, msg string, fields ...zap.Field)
- func (log GLogger) WithInfof(ctx *context.Context, msg string, args ...interface{})
- func (log GLogger) WithWarnf(ctx *context.Context, msg string, args ...interface{})
- func (log GLogger) Withf(args []interface{}) *zap.SugaredLogger
- type GLoggerConfig
- type LogPayload
Constants ¶
View Source
const ( RequestID string = "requestId" PlatformID string = "platformId" UserFlag string = "userflag" Duration string = "duration" Size string = "size" UserAgent string = "userAgent" Referer string = "referer" Method string = "method" Url string = "url" ServerIP string = "serverip" SourceIP string = "sourceip" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FormatTemplateWithor ¶ added in v0.1.2
type FormatTemplateWithor interface { }
type GLogger ¶
type GLogger struct {
// contains filtered or unexported fields
}
func CreateLog ¶
func CreateLog(gconfig GLoggerConfig) GLogger
func WithContext ¶
func (GLogger) SetContext ¶ added in v0.1.2
func (GLogger) WithErrorf ¶ added in v0.1.3
func (GLogger) Withf ¶ added in v0.1.2
func (log GLogger) Withf(args []interface{}) *zap.SugaredLogger
TODO 待优化,既然格式一定,是不是可以暂时直接写死
type GLoggerConfig ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.