mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-10 15:03:30 -07:00
pkg/log: add type field for errors
This commit is contained in:
+4
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user