oopslogrus

package module
v0.0.0-...-55e40f1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 3 Imported by: 4

README

Logrus formatter for Oops

import oopslogrus "github.com/samber/oops/loggers/logrus"

func init() {
    logrus.SetFormatter(
        oopslogrus.NewOopsFormatter(
	    &logrus.JSONFormatter{},
        )
    )
}

func main() {
    err := oops.
        With("driver", "postgresql").
        With("query", query).
        With("query.duration", queryDuration).
        Errorf("could not fetch user")

    if err != nil {
    	logrus.WithError(err).Error(err)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOopsFormatter

func NewOopsFormatter(secondaryFormatter logrus.Formatter) *oopsFormatter

Types

This section is empty.

Jump to

Keyboard shortcuts

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