dazl icon indicating copy to clipboard operation
dazl copied to clipboard

Add context.Context fields support and customized values

Open matdurand opened this issue 2 years ago • 0 comments

Great job creating something akin to slf4j.

Some things I would love to see in the lib before I can adopt this:

  • Support for context.Context: It's often useful to be able to access values from the context while logging. The obvious example is traceID. slog has these DebugCtx, InfoCtx ... methods for this. I feel like their implementation is a bit rough on the edges atm and it's not obvious how to use it, but still, the need for something like this is obvious I think. Which form it should take, I'm not sure...
  • Support for customization when logging values: Again, borrowing from the slog handbook, the ability to centralized the logic for how a value is logged is useful. For example, when redacting secrets from logs. I understand that this might be a problem for dazl to support this for each underlaying implementation, but maybe that could be addressed by dazl and it would pass down the serialized value (after the redaction for example) to the implementation.

matdurand avatar May 05 '23 15:05 matdurand