Skip to content
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

Finalize and expose the new logger interface #1270

Closed
1 task done
sagikazarmark opened this issue Dec 28, 2021 · 3 comments · Fixed by #1627
Closed
1 task done

Finalize and expose the new logger interface #1270

sagikazarmark opened this issue Dec 28, 2021 · 3 comments · Fixed by #1627
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@sagikazarmark
Copy link
Collaborator

Preflight Checklist

  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Problem Description

A new Logger interface has been introduced to prepare dropping JWW as a dependency (at least from the code, it's still used as the default logger implementation for backward compatibility reasons).

As pointed out in #1268 though, there is no way to provide a custom implementation at the moment. While I don't necessarily see that as a critical problem (JWW works and it's a dependency anyway), we definitely want to drop JWW, so allowing users to customize the logger is inevitable.

Proposed Solution

Expose a WithLogger option for Viper to allow customizing the logger implementation.

Alternatives Considered

No response

Additional Information

Before exposing the interface, we need to finalize it (ie. agree that the current contract is suitable for Viper in the long-term). The current interface is modeled directly after the JWW usage.

Logger abstractions out there:

The contract should be defined by Viper as the consumer of the interface.

@sagikazarmark sagikazarmark added the kind/enhancement New feature or request label Dec 28, 2021
@sagikazarmark sagikazarmark self-assigned this Dec 28, 2021
Repository owner deleted a comment from github-actions bot Dec 28, 2021
@sagikazarmark sagikazarmark added this to the 2022 Q1 milestone Dec 28, 2021
@sagikazarmark sagikazarmark modified the milestones: 2022 Q1, v1.11.0 Jan 1, 2022
@sagikazarmark sagikazarmark modified the milestones: 2022 Q1, 2022 Q2 Apr 12, 2022
@sagikazarmark sagikazarmark modified the milestones: 2022 Q3, 2022 Q4 Oct 13, 2022
@sagikazarmark
Copy link
Collaborator Author

The interface was kept intentionally closed to make sure it's the best we can do.

However, there is some work going on in the Go community to add a structured logger to the standard library. Let's see how that works out, before introducing a custom interface.

@sagikazarmark sagikazarmark modified the milestones: 2022 Q4, 2023 Nov 6, 2022
@jantytgat
Copy link

Any updates on the customer interface? Or switching to stdlib slog entirely?

@sagikazarmark
Copy link
Collaborator Author

Yes, the plan is to switch to slog. I'm working on a solution to make sure we can make the switch in a backward compatible manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants