-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
encountering the error when connecting with database by gorm.Open should not print a error log #6260
Comments
How does printing the error log affect you? In fact, gorm will print error logs in many cases, including query errors. |
you can use custom Logger replace Default Logger in gorm.Config |
Except for the error logging, no any other side effect actually. In my use scenario, I have already handled the error, but it still print the error log, which is invalid personally. |
Okay, thanks, I will try it later. :) |
User can also control it by logging level https://gorm.io/docs/logger.html#Log-Levels |
Thanks. :) |
Your Question
When using docker compose start mysql and app, because mysql init need some time, gorm.Open will throw error and print a error log
Throwing a error is okay, I don't think it should print a error log here
The document you expected this should be explained
If checking with the following, the error has been handled before the timeout, so printing error log is not okay here
Expected answer
Remove this printing error log:
The text was updated successfully, but these errors were encountered: