Skip to content

Commit be97699

Browse files
committed
Explain soon deprecation of LegacyTracer
**Motivation:** This type will be deprecated as soon as possible and only serves as a bridge for Swift 5.6 adopters.
1 parent ef5d3db commit be97699

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/Tracing/TracerProtocol+Legacy.swift

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ import Dispatch
1616
@_exported import Instrumentation
1717
@_exported import InstrumentationBaggage
1818

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

0 commit comments

Comments
 (0)