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.9+ (Xcode 15+)
- iOS 13+, macOS 10.15+
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.
We can get in touch via Twitter/X, Discord, Mastodon, Threads, Bluesky.
Alternatively you can visit my Website.