Skip to content

Conversation

@ccoVeille
Copy link

@ccoVeille ccoVeille commented Oct 24, 2025

This commit introduces an optional logger parameter to various structs.
This enhancement allows users to provide custom logging implementations.

This is a naive implementation of #3558

It is provided to iterate on the changes, there are many things that are missing:

  • tests
  • WithLogger should be added at multiple places

Also, the current discussion in #3558 let me think the current logging interface should be reconsidered, so everything will have to be refactored.

This commit introduces an optional logger parameter to various structs.
This enhancement allows users to provide custom logging implementations.
@jit-ci
Copy link

jit-ci bot commented Oct 24, 2025

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@ndyakov
Copy link
Member

ndyakov commented Oct 24, 2025

@ccoVeille thank you for opening this PR. I am willing to work with you on improving the logging and do agree that the current interface lacks some useful features. If you have a current need to just be able to set logger per client, we can improve this initially and then continue on the whole logging interface.

@ccoVeille
Copy link
Author

I found a workaround by injecting a dedicated logger in the context and restoring from the context in the current Printf interface.

So I don't have a need right now. We can work together on the target solution you planned initially for the v10 with a fallback for the v9

@ndyakov
Copy link
Member

ndyakov commented Oct 28, 2025

so @ccoVeille would you consider this pr ready for review ?

@ccoVeille
Copy link
Author

Yes, you can review. I'm curious about your feedback.

I dislike the idea it adds a configuration option in each struct that satisfies the current internal.Logging interface.

I feel like we shouldn't add option with interface we may change for supporting the log level and other things you listed.

So here I'm open to suggestions.

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.

2 participants