Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteErrList ¶
Types ¶
type Config ¶
type Config struct {
// RuntimeFrames is true if stack traces should retain frames from the runtime package.
RuntimeFrames bool
// TestingFrames is true if stack traces should retain frames from the testing package.
TestingFrames bool
// EventLoc is true if Event.Loc should be populated.
EventLoc bool
// Stack is true if Error.Stack should be populated.
Stack bool
// Cause is true if Error.Cause should be populated and all Error.Msg values should be restored
// to their original values (without messages of prior causes appended).
Cause bool
}
func DefaultConfig ¶
func DefaultConfig() Config
type Error ¶
type Error struct {
// Msg is message from the topmost error.
Msg string
// Loc is the error creation site, if available (e.g. from pkg/errors).
Loc Location
// Stack includes locations leading to, but excluding, Error.Loc, if available (e.g. from pkg/errors).
Stack []Location `json:",omitempty"`
// Cause includes the errors leading to, but excluding, this Error, if available (e.g. from pkg/errors).
Cause []Error `json:",omitempty"`
}
type Event ¶
type Event struct {
// Loc is the event creation site.
Loc Location
// Errors holds one or more errors collected at the event creation site.
Errors []Error
}
Event aims to provide error detail for inclusion in a structured log.
It omits a time value, assuming the structured logger will include it.
Click to show internal directories.
Click to hide internal directories.