logger

package
v3.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

README

Middleware information

This folder contains a middleware which is a bridge between Iris station's logger and http requests.

Logs the incoming requests

How to use

Read the logger section here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(theLogger *logger.Logger, options ...Options) iris.HandlerFunc

New returns the logger middleware as HandlerFunc with the default settings if second parameter is not passed

Types

type Options

type Options 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
	// EnableColors defaults to false
	EnableColors bool
}

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

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns an options which all properties are true

Jump to

Keyboard shortcuts

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