logger

package
v0.0.0-...-729a1dc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Log this is the variable where the logger are stored

Functions

func InitLogger

func InitLogger()

InitLogger initialise logger variable

func New

func New(configs ...Config) fiber.Handler

New is a zerolog middleware that allows you to pass a Config.

app := fiber.New()

// Without config
app.Use(logger.New())

// With config
app.Use(New(Config{Logger: &zerolog.New(os.Stdout)}))

Types

type Config

type Config struct {
	// Next defines a function to skip this middleware.
	Next func(ctx *fiber.Ctx) bool

	// Logger is a *zerolog.Logger that writes the logs.
	//
	// Default: log.Logger.Output(zerolog.ConsoleWriter{Out: os.Stderr})
	Logger *zerolog.Logger
}

Config defines the config for logger middleware.

Jump to

Keyboard shortcuts

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