Skip to content

Add log setting to panic when field is overwritten #243

Description

@TheJokr

When log fields are added in a loop without forking the logger, it is easy to create very long logger chains and hit stack overflows on drop. We have some workarounds in place already to help detect such cases (#47 and #189), but a key insight is that often the same key will be set many times.

A new LoggingSetting that makes foundations panic when a key is overwritten would help detect such cases. Sometimes overriding a key is intentional, so we also need an escape hatch in the log::add_fields macro that explicitly allows overwriting existing keys.

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