logger

package
v0.0.0-...-20f3002 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package logger provides request logging via middleware. See _examples/beginner/request-logger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg ...Config) context.Handler

New creates and returns a new request logger middleware. Do not confuse it with the framework's Logger. This is for the http requests.

Receives an optional configuation.

Types

type Config

type Config struct {
	// Status displays status code (bool)
	Status bool
	// IP displays request's remote address (bool)
	IP bool
	// Method displays the http method (bool)
	Method bool
	// Path displays the request path (bool)
	Path bool
}

Config are the options of the logger middlweare contains 4 bools Status, IP, Method, Path if set to true then these will print

func DefaultConfiguration

func DefaultConfiguration() Config

DefaultConfiguration returns an options which all properties are true except EnableColors

Jump to

Keyboard shortcuts

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