Discover Packages
github.com/go-pkgz/rest
logger
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Jan 14, 2019
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 37 modules, 36 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Logger returns default logger middleware with REST prefix
type Backend interface {
Logf(format string , args ...interface{})
}
Backend is logging backend
Flag type
const (
All Flag = iota
User
Body
None
)
logger flags enum
type Middleware struct {
}
Middleware for logging rest requests
New makes rest Logger with given options
func (*Middleware) Handler ¶
Handler middleware prints http log
Option func type
Flags functional option defines output modes
IPfn functional option defines ip masking function.
Log functional option defines loging backend.
MaxBodySize functional option defines the largest body size to log.
Prefix functional option defines log line prefix.
UserFn functional option defines user name function.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.