Skip to content

improve logging output for async and sync migrate functions #378

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BentEngbers
Copy link

@BentEngbers BentEngbers commented Apr 16, 2025

The previous log messages included applied_migrations.iter().map(ToString::to_string), which use the debug implementation for displaying the applied migrations. I have replaced them with let migrations_display = applied_migrations .iter() .map(ToString::to_string) .collect::<Vec<String>>() .join("\n");.

Additionally, for easier debugging of long-running migrations (when not in batch mode), a log message is now added before and after each migration. These messages are aligned with a \t:

[2025-04-16T09:27:40Z INFO  refinery_core::traits::sync] applying migration:     V1__foo ...
[2025-04-16T09:27:40Z INFO  refinery_core::traits::sync] applied migration:      V1__foo writing state to db.
[2025-04-16T09:27:40Z INFO  refinery_core::traits::sync] applying migration:     V2__bar ...
[2025-04-16T09:27:40Z INFO  refinery_core::traits::sync] applied migration:      V2__bar state to db.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants