From adf9b80fb7aa77f25666d1fbe93391bd1086260c Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 10 Feb 2017 16:50:55 +0800 Subject: [PATCH] Refactor format log for postgres --- logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logger.go b/logger.go index 2d07df5c..117b0403 100644 --- a/logger.go +++ b/logger.go @@ -73,7 +73,7 @@ var LogFormatter = func(values ...interface{}) (messages []interface{}) { if numericPlaceHolderRegexp.MatchString(values[3].(string)) { sql = values[3].(string) for index, value := range formattedValues { - placeholder := fmt.Sprintf(`\$%d([^\d])`, index+1) + placeholder := fmt.Sprintf(`\$%d([^\d]|$)`, index+1) sql = regexp.MustCompile(placeholder).ReplaceAllString(sql, value+"$1") } } else {