pkg/log: add type field for errors
This commit is contained in:
parent
3c23a854c8
commit
e266d218db
1 changed files with 4 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue