logger

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPLogging

func HTTPLogging(logger Logger) func(http.Handler) http.Handler

HTTPLogging wraprs a handler to perform logging when requests are made

Types

type Logger

type Logger interface {
	Info(args ...interface{})
	Infof(msg string, args ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Debug(args ...interface{})
	Debugf(msg string, args ...interface{})
	Debugw(msg string, keysAndValues ...interface{})
	Error(args ...interface{})
	Errorf(msg string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Fatal(args ...interface{})
}

Logger interface exposes the necessary logger functions

func New

func New(debug bool) (Logger, func() error, error)

New returns a new Logger instance with the desired fields

func WithFields

func WithFields(log Logger, fields map[string]interface{}) Logger

WithFields adds fields to the provided logger instance

Jump to

Keyboard shortcuts

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