feat: support %w in logx.Errorf (#1278)

This commit is contained in:
Kevin Wan
2021-11-26 15:57:23 +08:00
committed by GitHub
parent 3dda557410
commit de5ed6a677
2 changed files with 12 additions and 1 deletions

View File

@@ -217,7 +217,7 @@ func ErrorCaller(callDepth int, v ...interface{}) {
// ErrorCallerf writes v with context in format into error log.
func ErrorCallerf(callDepth int, format string, v ...interface{}) {
errorTextSync(fmt.Sprintf(format, v...), callDepth+callerInnerDepth)
errorTextSync(fmt.Errorf(format, v...).Error(), callDepth+callerInnerDepth)
}
// Errorf writes v with format into error log.