onerror

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 7 Imported by: 7

README

onerror

Handle error logging

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(err error)

Log logs an error

func LogHTTP

func LogHTTP(err error, r *http.Response, doNotCloseBody bool) error

LogHTTP logs and HTTP-related error

func Panic

func Panic(err error)

Panic asserts that no error was given

func Warn

func Warn(err error)

Warn warns on error

Types

type Entry added in v0.2.0

type Entry struct {
	*log.Entry
}

Entry wraps logrus.Entry

func WithEntry added in v0.2.0

func WithEntry(e *log.Entry) *Entry

WithEntry uses the given logrus.Entry

func (*Entry) Log added in v0.2.0

func (e *Entry) Log(err error)

Log logs an error

func (*Entry) LogHTTP added in v0.2.0

func (e *Entry) LogHTTP(err error, r *http.Response, doNotCloseBody bool) error

LogHTTP logs and HTTP-related error

func (*Entry) Panic added in v0.2.0

func (e *Entry) Panic(err error)

Panic asserts that no error was given

func (*Entry) Warn added in v0.2.0

func (e *Entry) Warn(err error)

Warn warns on error

func (*Entry) WithFields added in v0.2.0

func (e *Entry) WithFields(f log.Fields) *Entry

WithFields adds fields to the entry

Jump to

Keyboard shortcuts

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