Skip to content

Commit 6f09ee0

Browse files
authored
Merge branch 'master' into update-codeowners
2 parents 51c1a21 + a6cddf9 commit 6f09ee0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

go/logic/migrator.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,14 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
10421042
)
10431043
w := io.MultiWriter(writers...)
10441044
fmt.Fprintln(w, status)
1045-
this.migrationContext.Log.Infof(status)
1045+
1046+
// This "hack" is required here because the underlying logging library
1047+
// github.com/outbrain/golib/log provides two functions Info and Infof; but the arguments of
1048+
// both these functions are eventually redirected to the same function, which internally calls
1049+
// fmt.Sprintf. So, the argument of every function called on the DefaultLogger object
1050+
// migrationContext.Log will eventually pass through fmt.Sprintf, and thus the '%' character
1051+
// needs to be escaped.
1052+
this.migrationContext.Log.Info(strings.Replace(status, "%", "%%", 1))
10461053

10471054
hooksStatusIntervalSec := this.migrationContext.HooksStatusIntervalSec
10481055
if hooksStatusIntervalSec > 0 && elapsedSeconds%hooksStatusIntervalSec == 0 {

0 commit comments

Comments
 (0)