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

ParseSQLMigration doesn't respect goose.SetLogger(...) or goose.WithNoColor(true)(nil) #834

Open
szymon opened this issue Oct 10, 2024 · 1 comment

Comments

@szymon
Copy link

szymon commented Oct 10, 2024

Hi, if I call

goose.SetVerbose(true)
goose.WithNoColor(true)(nil)
goose.SetLogger(MyGooseLogger)

then goose.Up(...) will output logs from ParseSQLMigration using the standard logger, from "log" module, and then using MyGooseLogger it will print the operations on the database like: Begin transaction or Executing statement: create table xxx ...

@mfridman
Copy link
Collaborator

Curious, are you actually interested in output from debug parsing?

I believe this was always intended to be for developer debugging and less for "verbose output", so we could probably decouple this from the verbose option.

Also, we can't propagate the goose.Logger into this package because it'd cause an import cycle since goose itself imports the sqlparser package.

I've always want to add a separate EnableDebug which would control logging in the parser and leaving SetVerbose only for goose output.

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

No branches or pull requests

2 participants