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

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