Swiftpack.co -  Package - swift-server/swift-backtrace
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
swift-server/swift-backtrace
💥 Backtraces for Swift on Linux
.package(url: "https://github.com/swift-server/swift-backtrace.git", from: "1.2.1")

Backtrace

This Swift package provides support for automatically printing crash backtraces of Swift programs.

Usage

Add https://github.com/swift-server/swift-backtrace.git as a dependency in your Package.swift.

Crash backtraces

In your main.swift, do:

import Backtrace

// Do this first
Backtrace.install()

Finally, for Swift < 5.2, make sure you build your application with debug symbols enabled. Debug symbols are automatically included for Swift 5.2 and above.

$ swift build -c release -Xswiftc -g

When your app crashes, a stacktrace will be printed to stderr.

Acknowledgements

Ian Partridge (GitHub, Twitter) the original author of this package.

Johannes Weiss (GitHub, Twitter) for the signal handling code.

GitHub

link
Stars: 206
Last commit: 5 weeks ago

Release Notes

SwiftBacktrace 1.2.1
7 weeks ago

SemVer patch

  • Determine the executable path automatically #36
  • Improve error reporting in SwiftBacktrace if something goes wrong #35

Other improvements

  • Various CI improvements (#26, #27, #31, #32)

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