Skip to content
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

feat: add optional logging in Provider with verbose option #668

Merged
merged 5 commits into from
Dec 16, 2023

Conversation

mfridman
Copy link
Collaborator

@mfridman mfridman commented Dec 15, 2023

Fix #652, if using the Provider, and adding the WithVerbose() option, goose will print log output from applied migrations (omitted by default when that option is not added).

No strong feelings about the format itself, all of them are prefixed with goose: and are properly aligned.

up

2023/12/15 23:18:39 goose: OK    up 00001_users_table.sql (991.79µs)
2023/12/15 23:18:39 goose: OK    up 00002_posts_table.sql (378.96µs)
2023/12/15 23:18:39 goose: OK    up 00003_comments_table.sql (338µs)
2023/12/15 23:18:39 goose: OK    up 00004_insert_data.sql (330µs)
2023/12/15 23:18:39 goose: OK    up 00005_posts_view.sql (565.88µs)
2023/12/15 23:18:39 goose: EMPTY up 00006_posts_view copy.sql (272.5µs)
2023/12/15 23:18:39 goose: successfully migrated database, current version: 6

down-to 0

2023/12/15 23:19:21 goose: EMPTY down 00006_posts_view copy.sql (558µs)
2023/12/15 23:19:21 goose: OK    down 00005_posts_view.sql (669.88µs)
2023/12/15 23:19:21 goose: OK    down 00004_insert_data.sql (410.88µs)
2023/12/15 23:19:21 goose: OK    down 00003_comments_table.sql (441.46µs)
2023/12/15 23:19:21 goose: OK    down 00002_posts_table.sql (430.54µs)
2023/12/15 23:19:21 goose: OK    down 00001_users_table.sql (440.67µs)
2023/12/15 23:19:21 goose: successfully migrated database, current version: 0
  • Fix down
  • Ensure we also print the empty state (when there are no migrations)
  • Anything else?

@mfridman mfridman changed the title [WIP] - Add optional logging in Provider feat: add optional logging in Provider with verbose option Dec 16, 2023
@mfridman mfridman merged commit b114337 into master Dec 16, 2023
9 checks passed
@mfridman mfridman deleted the gh652-logging branch December 16, 2023 04:30
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.

Formatting MigrationResults in a custom Provider
1 participant