log

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

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

Index

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL