Closed porglezomp closed 6 days ago
(Sorry @Traced that the commit messages tag you, I didn't mean to do that! 🙇🏻♀️)
My bad with the trailing commas, I tested on 5.9 but not on 6.0, and I was using a toolchain with https://github.com/swiftlang/swift-evolution/pull/2344
Replaced by: in https://github.com/apple/swift-distributed-tracing-extras/pull/42 -extras
This provides a
@Traced
macro which adds a tracing span around the body of the function. This macro allows customizing theoperationName
, thecontext
, and thekind
of the span, same as thewithSpan
function. It also exposes the span itself into the scope of the function, with a customizable name.This doesn't attempt to support automatically adding parameters as attributes, because the scoping rules of attached macros aren't very amenable to controlling that. That could be added in the future if it's judged necessary.
Examples:
expands to:
Notes:
This places the macros into a separate product so that users who don't want to pay the compile-time cost of macros don't have to use it, you opt-in to that cost by depending on the
TracingMacros
module.This adds minimum OS versions for Apple platforms in order to be able to depend on SwiftSyntax. This applies to the whole package since there are no per-target platform specifications. Most notably: This raises the macOS minimum deployment target from the (implicit) 10.13 to 10.15 (matching SwiftSyntax).
Resolves #125