mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-26 01:18:10 -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.
|
// LogFields provides Fields for logging.
|
||||||
func (e err) LogFields() Fields {
|
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.
|
// Err is a wrapper around errors that implements Fielder.
|
||||||
|
|||||||
Reference in New Issue
Block a user