Documentation ¶
Index ¶
- Variables
- func EncodeLevel(lv zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func LogHTTPRequest(req *HTTPRequest) zapcore.Field
- func LogReportLocation(loc *ReportLocation) zapcore.Field
- func LogServiceContext(ctx *ServiceContext) zapcore.Field
- func LogUser(user string) zapcore.Field
- type Context
- type Core
- type HTTPRequest
- type ReportLocation
- type ServiceContext
Constants ¶
This section is empty.
Variables ¶
View Source
var EncoderConfig = zapcore.EncoderConfig{ TimeKey: "eventTime", LevelKey: "severity", NameKey: "logger", CallerKey: "caller", MessageKey: "message", StacktraceKey: "stacktrace", LineEnding: zapcore.DefaultLineEnding, EncodeLevel: EncodeLevel, EncodeTime: zapcore.ISO8601TimeEncoder, EncodeDuration: zapcore.SecondsDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, }
Functions ¶
func EncodeLevel ¶
func EncodeLevel(lv zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
func LogHTTPRequest ¶
func LogHTTPRequest(req *HTTPRequest) zapcore.Field
func LogReportLocation ¶
func LogReportLocation(loc *ReportLocation) zapcore.Field
func LogServiceContext ¶
func LogServiceContext(ctx *ServiceContext) zapcore.Field
Types ¶
type Context ¶
type Context struct { User string `json:"user"` HTTPRequest *HTTPRequest `json:"httpRequest"` ReportLocation *ReportLocation `json:"reportLocation"` }
func (*Context) MarshalLogObject ¶
func (c *Context) MarshalLogObject(e zapcore.ObjectEncoder) (err error)
type Core ¶
func (*Core) Check ¶
func (c *Core) Check(entry zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
type HTTPRequest ¶
type HTTPRequest struct { Method string `json:"method"` URL string `json:"url"` UserAgent string `json:"userAgent"` Referrer string `json:"referrer"` ResponseStatusCode int `json:"responseStatusCode"` RemoteIP string `json:"remoteIp"` }
func (*HTTPRequest) Clone ¶
func (h *HTTPRequest) Clone() *HTTPRequest
func (*HTTPRequest) MarshalLogObject ¶
func (h *HTTPRequest) MarshalLogObject(e zapcore.ObjectEncoder) error
type ReportLocation ¶
func (*ReportLocation) Clone ¶
func (r *ReportLocation) Clone() *ReportLocation
func (*ReportLocation) MarshalLogObject ¶
func (r *ReportLocation) MarshalLogObject(e zapcore.ObjectEncoder) error
type ServiceContext ¶
func (*ServiceContext) Clone ¶
func (s *ServiceContext) Clone() *ServiceContext
func (*ServiceContext) MarshalLogObject ¶
func (s *ServiceContext) MarshalLogObject(e zapcore.ObjectEncoder) error
Click to show internal directories.
Click to hide internal directories.