Swiftpack.co - grigorye/GETracing as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by grigorye.
grigorye/GETracing 0.1.2
Seamless tracing for Swift.
⭐️ 1
🕓 2 weeks ago
.package(url: "https://github.com/grigorye/GETracing.git", from: "0.1.2")

Actions Status


Easily trace value and literal of a Swift expression right at the point of evaluation.

If the built-in dump could capture the literal of the expression that produces the value on the caller side*, this whole thing would likely not exist.


  • Avoid repeating yourself.
  • Avoid introducing variables just to keep a value of expression (otherwise re-evaluated) for logging. Evaluate just once, whether there's tracing or not.
  • Get the expression literals traced in addition to the values.
  • Keep the code changes to the minimum. Make tracing (and reverting from tracing) as seamless as possible.


Any Swift expression


that needs tracing is replaced with


and that's it. Nested expressions might be traced as well.


x$ alternative might be defined as necessary by the client.

Logging implementation should be defined by the client.


Tracing might be reverted by removal of x$() or even removal of x$, leaving () in place.

Alternatively, tracing might be disabled per-block.

Current Limitations

It's required to bundle the corresponding source files together with the modules, if you want to see the expression literals for the traced stuff, as they're looked up at runtime. It might be improved later. For now, for performance reasons, it's possible to disable the lookup completely. (Theoretically) it's possible to recover the literals given the traced output with lookups disabled.

Related Projects

Tuna Xcode Plugin


* Long live #__VA_ARGS___ and C-preprocessor!


Stars: 1
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

3 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics