ginlogrus

package module
v0.0.0-...-2f4da50 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 4 Imported by: 13

README

ginlogrus

logger middleware for gin and logrus

Documentation

Index

Constants

View Source
const (
	Key = "ginlogrus"
)

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(c *gin.Context) *logrus.Entry

GetLogger takes a gin context and returns a logrus Entry logger if it exists on the gin context. If it does not exist it returns nil

func New

func New(logger *logrus.Logger, skipPaths ...string) gin.HandlerFunc

New returns a gin compatable middleware using logrus to defaultValue skipPaths only skips the INFO loglevel

func SetLogger

func SetLogger(c *gin.Context, logger *logrus.Entry)

SetLogger sets a logger on the current gin context

Types

This section is empty.

Jump to

Keyboard shortcuts

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