-
Notifications
You must be signed in to change notification settings - Fork 624
Open
Description
I like to use embedded migrations for testing. However, for each call to Up, this code is run:
log.Printf("goose: successfully migrated database to version: %d", current)
With more tests this becomes very inconvenient.
I could solve it by setting the output of the global default logger to io.Discard.
log.Default().SetOutput(io.Discard)but in general I would prefer to only discard the logger that is used by goose.
If we would allow to pass a logger as an Option we could not only suppress all logs (useful for tests), but also allow users to pass a logger that complies with their log level and log format.
There are only 52 occurrences of the log package in the goose code base.
If you think this could be useful for more people than just me, I am happy to put some work into this.
Maybe we could also use this opportunity so switch to log/slog?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels