lxLogMiddleware

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEchoLoggerConfig = EchoLoggerConfig{
		Skipper:         middleware.DefaultSkipper,
		Logger:          lxLog.GetLogger(),
		LoggerOutFormat: lxLog.GetOutFormat(),
	}
)

DefaultEchoLoggerConfig

Functions

func EchoLogger added in v1.2.9

func EchoLogger() echo.MiddlewareFunc

EchoLogger returns an EchoLogger middleware with default config. Default config based on logger init Usage: e.Use(lxLogMiddleware.EchoLogger())

func EchoLoggerWithConfig added in v1.2.9

func EchoLoggerWithConfig(config EchoLoggerConfig) echo.MiddlewareFunc

EchoLoggerWithConfig returns an EchoLogger middleware with custom config. Usage:

e.Use(lxLogMiddleware.EchoLoggerWithConfig(lxLogMiddleware.EchoLoggerConfig {
    Logger: log,
    OutFormat: lxLog.FormatText,
}))

Types

type EchoLoggerConfig added in v1.2.9

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

	// Logger instance
	Logger *logrus.Logger

	// LoggerOutFormat format for output.
	LoggerOutFormat lxLog.OutFormat
}

EchoLoggerConfig defines the config for EchoLoggerConfig middleware.

Jump to

Keyboard shortcuts

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