MCPcopy Index your code
hub / github.com/apache/devlake / formatMessage

Function formatMessage

backend/impls/logruslog/logger.go:135–145  ·  view source on GitHub ↗
(err error, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

133}
134
135func formatMessage(err error, msg string, args ...interface{}) string {
136 msg = fmt.Sprintf(msg, args...)
137 if err == nil {
138 return msg
139 }
140 formattedErr := strings.ReplaceAll(err.Error(), "\n", "\n\t")
141 if msg == "" {
142 return formattedErr
143 }
144 return fmt.Sprintf("%s\n\tcaused by: %s", msg, formattedErr)
145}
146
147var _ log.Logger = (*DefaultLogger)(nil)

Callers 3

WarnMethod · 0.85
ErrorMethod · 0.85
operatorFunction · 0.85

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected