Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion go/logic/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,14 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
)
w := io.MultiWriter(writers...)
fmt.Fprintln(w, status)
this.migrationContext.Log.Infof(status)

// This "hack" is required here because the underlying logging library
// github.com/outbrain/golib/log provides two functions Info and Infof; but the arguments of
// both these functions are eventually redirected to the same function, which internally calls
// fmt.Sprintf. So, the argument of every function called on the DefaultLogger object
// migrationContext.Log will eventually pass through fmt.Sprintf, and thus the '%' character
// needs to be escaped.
this.migrationContext.Log.Info(strings.Replace(status, "%", "%%", 1))

hooksStatusIntervalSec := this.migrationContext.HooksStatusIntervalSec
if hooksStatusIntervalSec > 0 && elapsedSeconds%hooksStatusIntervalSec == 0 {
Expand Down