Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swift-server/swift-backtrace
💥 Backtraces for Swift on Linux and Windows
https://github.com/swift-server/swift-backtrace
Last synced: 14 days ago
JSON representation
💥 Backtraces for Swift on Linux and Windows
- Host: GitHub
- URL: https://github.com/swift-server/swift-backtrace
- Owner: swift-server
- License: apache-2.0
- Archived: true
- Created: 2019-04-19T10:49:22.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T14:16:40.000Z (16 days ago)
- Last Synced: 2024-10-29T20:35:25.013Z (15 days ago)
- Language: C
- Homepage:
- Size: 182 KB
- Stars: 297
- Watchers: 13
- Forks: 34
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Security: SECURITY.md
Awesome Lists containing this project
README
# Backtrace
This Swift package provides support for automatically printing crash backtraces of Swift programs.
The library is designed to fill a gap in backtraces support for Swift on non-Darwin platforms.
When this gap is closed at the language runtime level, this library will become redundant and be deprecated.## Usage
**Note**: You do not need this library on Linux as of Swift 5.9, which has
built-in backtracing support.Add `https://github.com/swift-server/swift-backtrace.git` as a dependency in your `Package.swift`.
### Crash backtraces
In your `main.swift`, do:
```swift
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`.
## Security
Please see [SECURITY.md](SECURITY.md) for details on the security process.
## Acknowledgements
Ian Partridge ([GitHub](https://github.com/ianpartridge/), [Twitter](https://twitter.com/alfa)) the original author of this package.
Johannes Weiss ([GitHub](https://github.com/weissi), [Twitter](https://twitter.com/johannesweiss)) for the signal handling code.
Saleem Abdulrasool ([GitHub](https://github.com/compnerd), [Twitter](https://twitter.com/compnerd)) for the Windows port.