Nexus: Index | Files

package log

import ""

Package log provides utility functions that wrap Uber's Zap logging library


Package Files

doc.go log.go middleware.go mock.go

func NewLogger Uses

func NewLogger(logpath string, dev bool) (sugar *zap.SugaredLogger, err error)

NewLogger creates a default "sugared" logger based on dev toggle

func NewMiddleware Uses

func NewMiddleware(l *zap.SugaredLogger) func(next http.Handler) http.Handler

NewMiddleware instantiates a middleware function that logs all requests using the provided logger

func NewProcessLogger Uses

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 Uses

func NewTestLogger() (sugar *zap.SugaredLogger, out *observer.ObservedLogs)

NewTestLogger bootstraps a test logger that allows interrogation of output

Package log imports 9 packages (graph) and is imported by 7 packages. Updated 2019-01-18. Refresh now. Tools for package owners.