Skip to content

Use provided logger consistently in PostgresConnection.send(_:logger:) #299

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

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Jun 26, 2022

Probably affects no one whatsoever, since using a non-default logger per-query isn't actually implemented anywhere that I've seen, but might as well be consistent just the same.

@gwynne gwynne added the bug Something isn't working label Jun 26, 2022
@gwynne gwynne requested review from fabianfett and 0xTim June 26, 2022 12:00
@gwynne gwynne self-assigned this Jun 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2022

Codecov Report

Merging #299 (7089855) into main (2fa1cb1) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage   43.91%   43.91%           
=======================================
  Files         115      115           
  Lines        9680     9680           
=======================================
  Hits         4251     4251           
  Misses       5429     5429           
Flag Coverage Δ
unittests 43.91% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...es/PostgresNIO/Connection/PostgresConnection.swift 17.14% <0.00%> (ø)

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is not needed.

return self.send(PostgresCommands.prepareQuery(request: request), logger: self.logger).map { _ in

@gwynne
Copy link
Member Author

gwynne commented Jun 27, 2022

@fabianfett It's less about whether it's actually needed and more about being consistent with the usage elsewhere in the same method 🤷‍♀️. I mean, at the end of the day, there's no reason that the send methods of all the Fluent drivers take a logger parameter to begin with; nothing ever passes anything other than the existing logger to that parameter, it's not exposed to any of the higher layers, and it's not required by any protocol. It's just another of the weird warts on Fluent's API design. (And furthermore, on general principle of crabbiness, I accuse Mongo of being at fault, despite having made no effort whatsoever to find evidence to that effect 😆.)

That all being said, why not be consistent?

@fabianfett
Copy link
Collaborator

I'm stupid. You are right...

@fabianfett fabianfett merged commit 4b8ec14 into main Jun 27, 2022
@fabianfett fabianfett deleted the gwynne-patch-1 branch June 27, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants