logx

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 4 Imported by: 1 module, 1 package

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.

Documentation

Overview

Package logx is extension for log package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpAccessLogger

func NewHttpAccessLogger(logger *dlog.Logger, mux http.Handler) http.Handler

NewHttpAccessLogger returns a http.Handler that generates the following access log when using textHandler INFO 2019-01-05T18:04:03-08:00 /foo status=200 size=3 method=GET duration=4.225µs refer= If you need more customization, you should create a new struct

Types

type HttpAccessLogger

type HttpAccessLogger struct {
	// contains filtered or unexported fields
}

HttpAccessLogger is an example for how to use gommon/log for http access log

func (*HttpAccessLogger) ServeHTTP

func (ac *HttpAccessLogger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler interface

Jump to

Keyboard shortcuts

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