MCPcopy Create free account
hub / github.com/DOSNetwork/core / Error

Method Error

log/logger.go:91–108  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

89}
90
91func (l *logger) Error(err error) {
92 if l.entry == nil {
93 return
94 }
95 ss := strings.FieldsFunc(fmt.Sprintf("%+v", err), func(r rune) bool {
96 if r == '-' {
97 return true
98 }
99 return false
100 })
101 errCause := ""
102 if len(ss) >= 1 {
103 c := strings.Split(ss[len(ss)-1], ":")
104 errCause = c[0]
105 }
106 l.entry.WithFields(logrus.Fields{"errCause": errCause, "errDetail": fmt.Sprintf("%+v", err), "errType": reflect.TypeOf(err).String()}).Error()
107
108}
109
110func (l *logger) Fatal(err error) {
111 if l.entry == nil {

Callers

nothing calls this directly

Implementers 1

loggerlog/logger.go

Calls 2

ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected