Skip to content

Add context.Context fields support and customized values #3

@matdurand

Description

@matdurand

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions