This Swift package provides support for automatically printing crash backtraces of Swift programs.
Add https://github.com/swift-server/swift-backtrace.git as a dependency in your Package.swift.
In your main.swift, do:
import Backtrace
// Do this first
Backtrace.install()Finally, make sure you build your application with debug symbols enabled:
$ swift build -c release -Xswiftc -g
When your app crashes, a stacktrace will be printed to stderr.
Ian Partridge (GitHub, Twitter) the original author of this package.
Johannes Weiss (GitHub, Twitter) for the signal handling code.