logger

package
v0.0.0-...-0562527 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSentry

func InitSentry()

func NotifySentry

func NotifySentry(re ReportableError)

NotifySentry sends an event to sentry.io. Sentry is configurable via the environment variables SENTRY_ENVIRONMENT, SENTRY_DSN, SENTRY_RELEASE.

Types

type Logger

type Logger interface {
	Log(fields map[string]interface{})
	LogFromClientRequest(fields map[string]interface{}, req *http.Request)
	LogFromBackendRequest(fields map[string]interface{}, req *http.Request)
}

func New

func New(output interface{}) (logger Logger, err error)

New creates a new Logger. The output variable sets the destination to which log data will be written. This can be either an io.Writer, or a string. With the latter, this is either one of "STDOUT" or "STDERR", or the path to the file to log to.

type RecoveredError

type RecoveredError struct {
	ErrorMessage string
}

func (RecoveredError) Error

func (re RecoveredError) Error() string

type ReportableError

type ReportableError struct {
	Error    error
	Request  *http.Request
	Response *http.Response
}

func (ReportableError) Timeout

func (re ReportableError) Timeout() bool

Timeout returns true if and only if this ReportableError is a timeout.

Jump to

Keyboard shortcuts

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