logMiddleware

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEchoLogConfig = EchoLogConfig{
		Skipper:   middleware.DefaultSkipper,
		OutFormat: FormatText,
	}
)

DefaultEchoLogConfig

Functions

func EchoLog

func EchoLog(logger *logrus.Logger) echo.MiddlewareFunc

EchoLog returns an EchoLog middleware with default config. Example for use: e.Use(lxLogMiddleware.EchoLog(log))

func EchoLogWithConfig

func EchoLogWithConfig(config EchoLogConfig) echo.MiddlewareFunc

EchoLogWithConfig returns an EchoLog middleware with custom config. Example for use:

e.Use(lxLogMiddleware.EchoLogWithConfig(lxLogMiddleware.EchoLogConfig {
    Logger: log,
    OutFormat: lxLogMiddleware.FormatText,
}))

Types

type EchoLogConfig

type EchoLogConfig struct {
	// Skipper defines a function to skip middleware.
	middleware.Skipper

	// Logger instance
	Logger *logrus.Logger

	// OutFormat format for output.
	OutFormat Out
}

EchoLogConfig defines the config for EchoLogConfig middleware.

type Out

type Out int
const (
	FormatText Out = iota + 1
	FormatFluentd
)

Jump to

Keyboard shortcuts

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