Skip to content

Commit

Permalink
Explain soon deprecation of LegacyTracer
Browse files Browse the repository at this point in the history
**Motivation:**

This type will be deprecated as soon as possible and only serves as a
bridge for Swift 5.6 adopters.
  • Loading branch information
ktoso committed May 22, 2023
1 parent ef5d3db commit be97699
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Tracing/TracerProtocol+Legacy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ import Dispatch
@_exported import Instrumentation
@_exported import InstrumentationBaggage

/// A tracer protocol intended to support Swift 5.6 specifically.
///
/// **This protocol will be deprecated as soon as possible**, and the library will continue recommending Swift 5.7+
/// in order to make use of new language features that make expressing the tracing API free of existential types when not necessary.
///
/// When possible, prefer using ``Tracer`` and ``withSpan(_:baggage:ofKind:at:function:file:line:_:)-4o2b`` APIs,
/// rather than these `startAnySpan` APIs which unconditionally always return existential Spans even when not necessary
/// (under Swift 5.7+ type-system enhancement wrt. protocols with associated types)..
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal Baggage
public protocol LegacyTracer: Instrument {
/// Start a new span returning an existential ``Span`` reference.
Expand Down

0 comments on commit be97699

Please sign in to comment.