Skip to content

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

@atlet99

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.

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