Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOopsFormatter ¶
NewOopsFormatter creates a new logrus formatter that automatically detects and formats oops.OopsError instances in log entries.
This formatter wraps an existing logrus formatter and enhances it with oops error handling capabilities. When an oops.OopsError is detected in a log entry's "error" field, the formatter automatically extracts all error context, metadata, and stack traces and adds them to the log entry data.
If no secondary formatter is provided, the standard logrus formatter is used as the underlying formatter.
Example usage:
logger := logrus.New()
logger.SetFormatter(oopslogrus.NewOopsFormatter(nil))
logger.WithError(err).Error("operation failed")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.