slashmo / gsoc-swift-baggage-context

BaggageContext library, extracted from slashmo/gsoc-swift-tracing
https://github.com/slashmo/gsoc-swift-tracing
Apache License 2.0
4 stars 2 forks source link

Document context.description #27

Closed ktoso closed 3 years ago

ktoso commented 3 years ago

It's implemented correctly, by not printing values, however we should document why this is so.

extension BaggageContext: CustomStringConvertible {
    /// A context's description prints only keys of the contained values, 
    /// this is in order to prevent spilling a lot of detailed informational of carried values accidentally.
    ///
    /// BaggageContexts are not intended to be printed "raw" but rather inter-operate with tracing, logging and other systems,
    /// which can use the `forEach` function which does provide access to underlying values as well.
    public var description: String {

or something like that.