gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Decision: How to Pass Logger

Open danehans opened this issue 3 years ago • 6 comments

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 avatar Sep 06 '22 18:09 danehans

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

danehans avatar Sep 06 '22 18:09 danehans

I vote for option 1.

danehans avatar Sep 06 '22 18:09 danehans

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

LukeShu avatar Sep 06 '22 21:09 LukeShu

I think option 1 is preferable.

Alice-Lilith avatar Sep 07 '22 18:09 Alice-Lilith

I'll abstain, fine with whatever others prefer.

skriss avatar Sep 07 '22 19:09 skriss

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 https://github.com/envoyproxy/gateway/issues/76#issuecomment-1149604515

arkodg avatar Sep 07 '22 19:09 arkodg

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[bot] avatar Oct 08 '22 16:10 github-actions[bot]

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.

github-actions[bot] avatar Oct 15 '22 16:10 github-actions[bot]

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

danehans avatar Oct 15 '22 17:10 danehans