logging

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(l, logpath string) *zap.SugaredLogger

NewLogger creates a new default logger it will need to be closed with ``` defer logger.Desugar().Sync() ``` to make sure all has been piped out before terminating

func NewNoopLogger added in v0.12.0

func NewNoopLogger() *zap.SugaredLogger

Types

type LogEntry

type LogEntry struct {
	*LogFormatter
	// contains filtered or unexported fields
}

func (*LogEntry) Panic

func (l *LogEntry) Panic(v interface{}, stack []byte)

TODO @shipperizer see if implementing this or not

func (*LogEntry) Write

func (l *LogEntry) Write(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})

type LogFormatter

type LogFormatter struct {
	Logger LoggerInterface
}

LogFormatter is a simple logger that implements a middleware.LogFormatter.

func NewLogFormatter

func NewLogFormatter(logger LoggerInterface) *LogFormatter

func (*LogFormatter) NewLogEntry

func (l *LogFormatter) NewLogEntry(r *http.Request) middleware.LogEntry

NewLogEntry creates a new LogEntry for the request.

type LoggerInterface

type LoggerInterface interface {
	Errorf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Debugf(string, ...interface{})
	Fatalf(string, ...interface{})
	Error(...interface{})
	Info(...interface{})
	Warn(...interface{})
	Debug(...interface{})
	Fatal(...interface{})
}

Jump to

Keyboard shortcuts

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