Versions in this module Expand all Collapse all v12 v12.3.1 Feb 23, 2023 v12.3.0 Feb 22, 2023 v12.2.2 Feb 22, 2023 v12.2.1 Feb 22, 2023 v12.2.0 Feb 22, 2023 Changes in this version + var TClock = func(t time.Time) clockFunc + var UTC = clockFunc(func() time.Time { ... }) + func Skip(ctx *context.Context) + func SkipHandler(ctx *context.Context) + type AccessLog struct + Async bool + Blank []byte + BodyMinify bool + BufferTruncaters []BufferTruncater + BytesReceived bool + BytesReceivedBody bool + BytesSent bool + BytesSentBody bool + Clock Clock + Closers []io.Closer + Delim byte + FieldSetters []FieldSetter + FileTruncaters []FileTruncater + Flushers []Flusher + IP bool + KeepMultiLineError bool + LatencyRound time.Duration + PanicLog PanicLog + RequestBody bool + ResponseBody bool + TimeFormat string + Writer io.Writer + func File(path string) *AccessLog + func FileUnbuffered(path string) *AccessLog + func New(w io.Writer) *AccessLog + func (ac *AccessLog) AddFields(setters ...FieldSetter) *AccessLog + func (ac *AccessLog) AddOutput(writers ...io.Writer) *AccessLog + func (ac *AccessLog) Broker() *Broker + func (ac *AccessLog) Close() (err error) + func (ac *AccessLog) CloseContext(ctx stdContext.Context) (err error) + func (ac *AccessLog) Flush() (err error) + func (ac *AccessLog) Handler(ctx *context.Context) + func (ac *AccessLog) Print(ctx *context.Context, latency time.Duration, timeFormat string, code int, ...) (err error) + func (ac *AccessLog) SetFormatter(f Formatter) *AccessLog + func (ac *AccessLog) SetOutput(writers ...io.Writer) *AccessLog + func (ac *AccessLog) Truncate(n int) + func (ac *AccessLog) TruncateFile(size int64) (err error) + func (ac *AccessLog) Write(p []byte) (n int, err error) + type Broker struct + Notifier LogChan + func (b *Broker) CloseListener(ln LogChan) + func (b *Broker) NewListener() LogChan + type BufferTruncater interface + Truncate func(n int) + type CSV struct + DateScript string + Header bool + func (f *CSV) Format(log *Log) (bool, error) + func (f *CSV) SetOutput(dest io.Writer) + type Clock interface + Now func() time.Time + type FieldSetter func(*context.Context, *Fields) + type Fields = memstore.Store + func GetFields(ctx *context.Context) (fields *Fields) + type FileTruncater interface + Truncate func(size int64) error + type Flusher interface + Flush func() error + type Formatter interface + Format func(log *Log) (bool, error) + SetOutput func(dest io.Writer) + type JSON struct + EscapeHTML bool + HumanTime bool + Indent string + func (f *JSON) Format(log *Log) (bool, error) + func (f *JSON) SetOutput(dest io.Writer) + type Log struct + BytesReceived int + BytesSent int + Code int + Ctx *context.Context + Fields memstore.Store + IP string + Latency time.Duration + Logger *AccessLog + Method string + Now time.Time + Path string + PathParams memstore.Store + Query []memstore.StringEntry + Request string + Response string + TimeFormat string + Timestamp int64 + func (l *Log) BytesReceivedLine() string + func (l *Log) BytesSentLine() string + func (l *Log) Clone() Log + func (l *Log) RequestValuesLine() string + type LogChan chan Log + type PanicLog uint8 + const LogCallers + const LogHandler + const LogStack + type Template struct + Funcs template.FuncMap + Text string + Tmpl *template.Template + TmplName string + func (f *Template) Format(log *Log) (bool, error) + func (f *Template) LogText(log *Log) (string, error) + func (f *Template) SetOutput(dest io.Writer)