Skip to content

Implement Logger.is_enabled #4410

@lmolkova

Description

@lmolkova

Spec defines basic Logger.Enabled method which is now can be enabled/disabled per scope with config.

Filtering by severity and sampling are coming via open-telemetry/opentelemetry-specification#4290.

Having this API now (even before filtering/sampling is finalized in the spec) would help instrumentation to avoid doing potentially expensive operations when logging is not even configured, but also they can start leveraging is_enabled now and don't need to change when SDK starts supporting all the interesting cases behind it.

Related to open-telemetry/opentelemetry-python-contrib#3226 (review)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions