Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Guarantee LoggingBaggageContextCarrier Logger metadata includes baggage #28

@adam-fowler

Description

@adam-fowler

With the current implementation of LoggingBaggageContextCarrier there is no guarantee that the Logger it holds includes the baggage in it's metadata. It is down to the library author to ensure this is the case.

If I accept a LoggingBaggageContextCarrier as a parameter to an interface function I cannot guarantee when I ask for the logger I will get a logger with metadata augmented with the baggage. Maybe it would be better to make it clearer and add a loggerWithBaggage variable as an extension instead of assuming the baggage will be added to the Logger metadata.

extension LoggingBaggageContextCarrier {
    var loggerWithBaggage: Logger { logger.with(context: self.baggage) }
}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions