-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print status to migrationContext logger #1194
Print status to migrationContext logger #1194
Conversation
Hi @Svoyu - I see you approved this change, but I can't merge it because none of the workflows have run. It says, "First-time contributors need a maintainer to approve running workflows." Are you able to approve those to run? |
…r-simple-alternative
Hi @SocalNick, I've approved the workflows to run - all looks good! 😄 (P.S. I think @syoyu is a spam user so I've reported their account) |
Hi there, we're currently using a fork to get this functionalit - are there any plans for a new release soon? We can use the commit hash in the meanwhile if that's not in the works yet. @dm-2 |
The string `status` has the character `%` after the progress percentage number. When printed once again using the `Infof` function, this `%` is read as a directive for formatting and ends up showing `MISSING` in the output as shown below: 2024-01-31 12:49:54 INFO Copy: 0/0 100.0%!;(MISSING) Applied: 0; Backlog: 0/1000; Time: 0s(total), 0s(copy); streamer: mysql_bin.000002:79674; Lag: 0.00s, HeartbeatLag: 0.02s, State: migrating; ETA: due Simply changing `Infof` to `Info` does not work here because `this.migrationContext.Log` is an object of the type `DefaultLogger` in this repository, which uses the library https://github.com/outbrain/golib/log. That library uses formatting __even__ when the `Info`function is called: https://github.com/outbrain/golib/blob/2531e5dbcc71b6f8a4ccf1205c209ae89b7529fc/log/log.go#L191-L193 If this patch is not acceptible, then I can also just remove this line. The migration context logger prints the messages which are already printed to STDOUT once again to STDERR with the current time as a prefix. This change was introduced in the commit https://github.com/github/gh-ost/blob/515aa72d3d9b756e454b0168b4e57bc599b45e36/go/logic/migrator.go#L1039, introduced in the PR github#1194.
NOTE: This is a simple alternative to #1193
A Pull Request should be associated with an Issue.
Related issue: #1026
Description
Status is currently only sent to stdout. We'd like the status to also be sent to the migrationContext logger.
script/cibuild
returns with no formatting errors, build errors or unit test errors.