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

Decision: How to Pass Logger #344

Closed
danehans opened this issue Sep 6, 2022 · 9 comments
Closed

Decision: How to Pass Logger #344

danehans opened this issue Sep 6, 2022 · 9 comments
Labels
help wanted Extra attention is needed stale

Comments

@danehans
Copy link
Contributor

danehans commented Sep 6, 2022

A logger gets passed around a few different ways throughout EG. Let's make a decision on which approach should be used for the project. Making this decision will unblock #278:

  1. Pass a context and individual funcs can create a logger from the context.
  2. Pass logr.Logger as an input to funcs.
  3. Add a logr.Logger to go structs and log.NewLogger() when initializing the struct.
@danehans
Copy link
Contributor Author

danehans commented Sep 6, 2022

@arkodg @LukeShu @youngnick @skriss I request your vote on this issue so we can unblock #344.

@danehans
Copy link
Contributor Author

danehans commented Sep 6, 2022

I vote for option 1.

@LukeShu
Copy link
Contributor

LukeShu commented Sep 6, 2022

I vote for option 1.

I wrote some about why/when I believe that context.Context-passing is the right decision over at https://github.com/datawire/dlib/blob/master/README.md#design-principles

@Alice-Lilith
Copy link
Member

I think option 1 is preferable.

@skriss
Copy link
Contributor

skriss commented Sep 7, 2022

I'll abstain, fine with whatever others prefer.

@arkodg
Copy link
Contributor

arkodg commented Sep 7, 2022

I prefer option 4 - Add global library logging scopes
This simplifies enabling component level logging and is also used in istio (here's an example)
More info on this is in #76 (comment)

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 8, 2022
@github-actions
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@danehans danehans added the help wanted Extra attention is needed label Oct 15, 2022
@danehans
Copy link
Contributor Author

Reopened so we can discuss and bring it to closure in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed stale
Projects
None yet
Development

No branches or pull requests

5 participants