logger

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logger provides functions to set up a new logger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *Logger) func(next http.Handler) http.Handler

SetLogger returns a middleware that logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return. Inspired by https://github.com/treastech/logger

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger is a small wrapper around a zap.Logger.

func New

func New(logLevel, logFormat string) (*Logger, error)

New creates a new Logger with given logLevel and logFormat as part of a permanent field of the logger.

Jump to

Keyboard shortcuts

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