Skip to content

Commit

Permalink
Refactor format log for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Feb 10, 2017
1 parent df6c3c9 commit adf9b80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit adf9b80

Please sign in to comment.