webhelp.v1: gopkg.in/webhelp.v1/whlog Index | Files

package whlog

import "gopkg.in/webhelp.v1/whlog"

Package whlog provides functionality to log incoming requests and results.

Index

Package Files

logging.go serve.go

func ListenAndServe Uses

func ListenAndServe(addr string, handler http.Handler) error

ListenAndServe creates a TCP listener prior to calling Serve. It also logs the address it listens on, and wraps given handlers in whcompat.DoneNotify. Like the standard library, it sets TCP keepalive semantics on.

func LogRequests Uses

func LogRequests(logger Loggerf, h http.Handler) http.Handler

LogRequests takes a Handler and makes it log requests (prior to request handling). whlog.Default makes a good default logger.

func LogResponses Uses

func LogResponses(logger Loggerf, h http.Handler) http.Handler

LogResponses takes a Handler and makes it log responses. LogResponses uses whmon's ResponseWriter to keep track of activity. whfatal.Catch should be placed *inside* if applicable. whlog.Default makes a good default logger.

type Loggerf Uses

type Loggerf func(format string, arg ...interface{})
var (
    Default Loggerf = log.Printf
)

Package whlog imports 7 packages (graph) and is imported by 2 packages. Updated 2017-06-04. Refresh now. Tools for package owners.