Documentation ¶
Overview ¶
Package log provides utility functions that wrap Uber's Zap logging library
Index ¶
- func NewLogger(logpath string, dev bool) (sugar *zap.SugaredLogger, err error)
- func NewMiddleware(l *zap.SugaredLogger) func(next http.Handler) http.Handler
- func NewProcessLogger(l *zap.SugaredLogger, process string, fields ...interface{}) *zap.SugaredLogger
- func NewTestLogger() (sugar *zap.SugaredLogger, out *observer.ObservedLogs)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
func NewLogger(logpath string, dev bool) (sugar *zap.SugaredLogger, err error)
NewLogger creates a default "sugared" logger based on dev toggle
func NewMiddleware ¶
NewMiddleware instantiates a middleware function that logs all requests using the provided logger
func NewProcessLogger ¶
func NewProcessLogger(l *zap.SugaredLogger, process string, fields ...interface{}) *zap.SugaredLogger
NewProcessLogger creates a new logger that sets prefixes on fields for logging a specific process
func NewTestLogger ¶
func NewTestLogger() (sugar *zap.SugaredLogger, out *observer.ObservedLogs)
NewTestLogger bootstraps a test logger that allows interrogation of output
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.