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
)
![](https://private-user-images.githubusercontent.com/1290461/335856153-c2f870b5-cb7c-42f0-bdfd-78b88b73bb3a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ3MTIwMTksIm5iZiI6MTcyNDcxMTcxOSwicGF0aCI6Ii8xMjkwNDYxLzMzNTg1NjE1My1jMmY4NzBiNS1jYjdjLTQyZjAtYmRmZC03OGI4OGI3M2JiM2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjZUMjIzNTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTJlOTE5NDNkNGVhNzA0M2U3MDY1OTcyMGUwMTkwMjhkZDhlMjk1OTBlNDJmNzZmMTI3NjA1MWFjNzQ2MjgwOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ZUC7LH2qUu7FjvXAYVoqqWG429_xjTwc0BSuRbIvzXs)
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, Email, Website.