Conversation
| return &Client{ | ||
| httpClient: httpClient, | ||
| httpClient: wrapper, | ||
| logger: logger, |
There was a problem hiding this comment.
I strongly recommend using ctxzap.Extract(ctx) to get the logger. Otherwise it makes things like logger.With(...) cumbersome:
logger := c.logger.With("name", zap.String(val))
logger.Debug(...)If anyone uses c.logger.Debug() instead of logger.Debug(), the fields specified in .With(...) won't be logged. Also if anyone modifies c.logger, it will change logging in other functions.
There was a problem hiding this comment.
yes this all makes sense! i was testing a few different things, and so verifying this less-than-ideal workaround allowed me to see logs from client.go was helpful information at the time, leading me to believe we weren't passing the context properly in lambdas. looks like @kans and @laurenleach identified and fixed the ctx issue in the sdk last week 🥳
ConductorOne/baton-sdk#413
Description
passing the logger as a field on the client fixes the lamdba outputs, but needs further investigation. are we not passing ctx properly in the sdk?
Useful links: