Skip to content

Commit

Permalink
Merge branch 'master' into update-codeowners
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-2 authored Jan 31, 2024
2 parents 51c1a21 + a6cddf9 commit 6f09ee0
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 6f09ee0

Please sign in to comment.