Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Incompatible with expected Writer interface #15

Closed
stevenh opened this issue Feb 28, 2024 · 3 comments · Fixed by #17
Closed

Incompatible with expected Writer interface #15

stevenh opened this issue Feb 28, 2024 · 3 comments · Fixed by #17
Labels
bug Something isn't working

Comments

@stevenh
Copy link

stevenh commented Feb 28, 2024

The naming of the expected logger interface for gorm infers that the parameters are to be given to a Print like method however the New method which is the standard way to create a Logger takes a Writer which defines Printf not Print so the expectation is Printf(format string), a ...any) not Print(a ...any)

The impact of that is errors thrown from gorm cause corrupt output:

msg="failed to initialize database, got error %v" !BADKEY="failed to connect to `host=localhost user=test_user database=test_database`: failed SASL auth (FATAL: password authentication failed for user \"test_user\" (SQLSTATE 28P01))"`
@orandin orandin added the bug Something isn't working label Mar 4, 2024
@injeniero
Copy link
Contributor

I also found the same issue, @orandin please let me know if you would like me to create a PR to fix this soon. Thanks!

@orandin
Copy link
Owner

orandin commented Mar 6, 2024

If you can create a PR to fix it before me, don't hesitate ! 😉

@injeniero
Copy link
Contributor

@orandin #17

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants