package
module
Version:
v0.0.0-...-cd49394
Opens a new window with list of versions in this module.
Published: Aug 20, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 5
Opens a new window with list of known importers.
README
¶
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
¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.