OSLogViewer is made for viewing your apps OS_Log history, it is a SwiftUI view which can be used in your app to view and export your logs.
Key features:
- View your apps OS_Log history
- Export logs
- Swift 5.8+ (Xcode 14.3+)
- iOS 16+, macOS 12+, watchOS 9+, tvOS 16+, visionOS 1+
Install using Swift Package Manager
dependencies: [
.package(url: "https://github.com/0xWDG/OSLogViewer.git", branch: "main"),
],
targets: [
.target(name: "MyTarget", dependencies: [
.product(name: "OSLogViewer", package: "OSLogViewer"),
]),
]
And import it:
import OSLogViewer
import OSLogViewer
NavigationLink {
// Default configuration
// uses your app's bundle identifier as subsystem
// and shows all logs from the last hour.
OSLogViewer()
} label: {
Text("View logs")
}
custom subsystem
import OSLogViewer
OSLogViewer(
subsystem: "nl.wesleydegroot.exampleapp",
)
custom time
import OSLogViewer
OSLogViewer(
since: Date().addingTimeInterval(-7200) // 2 hours
)
custom subsystem and time
import OSLogViewer
OSLogViewer(
subsystem: "nl.wesleydegroot.exampleapp",
since: Date().addingTimeInterval(-7200) // 2 hours
)

This is the OSLog archive for exampleapp
Generated on 2/6/2024, 11:53
Generator https://github.com/0xWDG/OSLogViewer
Info message
βΉοΈ 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
Error message
β 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
Error message
β 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
Critical message
βΌοΈ 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
Log message
π 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
Log message
π 2/6/2024, 11:53 ποΈ exampleapp βοΈ nl.wesleydegroot.exampleapp π myCategory
- 1.0.0
- Initial release
- 1.0.1
- Improved support for dark mode.
- Colors are more similar to Xcode's console.
- Added support for exporting logs.
- 1.0.2
- Fixed OSLogViewer on Mac not displaying correctly.
π¦ @0xWDG π mastodon.social/@0xWDG π¦ @0xWDG 𧡠@0xWDG π wesleydegroot.nl π€ Discord
Interested learning more about Swift? Check out my blog.