pkg/log: add type field for errors

This commit is contained in:
Jimmy Zelinskie 2020-05-07 13:15:43 -04:00
parent 3c23a854c8
commit e266d218db

View file

@ -50,7 +50,10 @@ type err struct {
// LogFields provides Fields for logging.
func (e err) LogFields() Fields {
return Fields{"error": e.e.Error()}
return Fields{
"error": e.e.Error(),
"type": fmt.Sprintf("%T", e.e),
}
}
// Err is a wrapper around errors that implements Fielder.