logging

package
v1.66.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

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

Types

type ExpandedError

type ExpandedError interface {
	Title() string
	Data() interface{}
}

An ExpandedError will set message and data of the line logged by Request to Title and Data respectively.

type Logger deprecated

type Logger struct {
	// contains filtered or unexported fields
}

A Logger writes information.

Deprecated: Prefer log/slog instead (which is used as the implementation here, if needed for an example of how it can be used).

func New

func New(out io.Writer, serviceName string) *Logger

func (*Logger) Fatal

func (l *Logger) Fatal(err error)

func (*Logger) Print

func (l *Logger) Print(v ...interface{})

func (*Logger) Request

func (l *Logger) Request(r *http.Request, err error)

Jump to

Keyboard shortcuts

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