Skip to content

fix: silence noisy go-sql-driver mysql logging - #827

Open
ChrisJr404 wants to merge 1 commit into
amacneil:mainfrom
ChrisJr404:silence-mysql-driver-log
Open

fix: silence noisy go-sql-driver mysql logging#827
ChrisJr404 wants to merge 1 commit into
amacneil:mainfrom
ChrisJr404:silence-mysql-driver-log

Conversation

@ChrisJr404

Copy link
Copy Markdown

When dbmate up --wait runs before the database is ready, go-sql-driver logs its own error lines straight to stderr, so the console fills up with [mysql] packets.go:37: unexpected EOF before the "Waiting for database" dots even show up. dbmate already reports the real connection error itself, and the other drivers don't spew this, so the driver's logging is just noise here.

This sets a NopLogger on the mysql config we build for our own connections. It stays scoped to dbmate's connections rather than touching the driver's global logger, so it won't silence go-sql-driver for anyone using dbmate as a library.

Part of #516 (the console spam that was asked to be fixed first). The --wait-interval flag from that issue is already covered by #803, so I kept this separate.

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.

1 participant