Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FastResponse is anything under this duration FastResponse = 500 * time.Millisecond // AcceptableResponse is anything under this duration AcceptableResponse = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { // Logger is a https://github.com/derekdowling/go-stdlogger Logger std.Logger // Debug will increase verbosity of logging information, and causes Query params not // to be omitted. Do NOT use in production otherwise you risk logging sensitive // information. Debug bool }
Logger contains instance state for a goji2logger to avoid configuration collisions if this middleware is used in multiple places
func (*Logger) Middleware ¶
Middleware logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return. When standard output is a TTY, Logger will print in color, otherwise it will print in black and white.
Use like so with Goji2:
gLogger := gojilogger.New(nil, false) yourGoji.UseC(gLogger.Middleware)
Click to show internal directories.
Click to hide internal directories.