Skip to content

[API] - make logboek.Context(ctx) safe (avoid panic) #75

Description

@atlet99

Problem

Context(ctx) panics when the logger is not stored in the context, which can crash libraries that rely on fallback behaviour.

Proposed Behaviour

Return DefaultLogger() and an error (or boolean) instead of panicking, or provide a helper MustContext() that panics while Context() is safe.

Tasks:

  • Decide the preferred API (breaking change? => semver bump).
  • Update call-sites & tests.
  • Document the change in README.md and doc.go.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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