Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xwdg/oslogviewer
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.
https://github.com/0xwdg/oslogviewer
0xwdg hacktoberfest logger oslog oslogviewer spm swift swift-lang swiftui
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/0xwdg/oslogviewer
- Owner: 0xWDG
- License: mit
- Created: 2024-06-01T15:22:35.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-10-04T14:17:10.000Z (4 months ago)
- Last Synced: 2024-10-10T14:26:33.124Z (3 months ago)
- Topics: 0xwdg, hacktoberfest, logger, oslog, oslogviewer, spm, swift, swift-lang, swiftui
- Language: Swift
- Homepage: https://0xwdg.github.io/OSLogViewer/
- Size: 1.32 MB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OSLogViewer
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.
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2F0xWDG%2FOSLogViewer%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/0xWDG/OSLogViewer)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2F0xWDG%2FOSLogViewer%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/0xWDG/OSLogViewer)
[![Swift Package Manager](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager)
![License](https://img.shields.io/github/license/0xWDG/OSLogViewer)_Key features:_
- View your apps OS_Log history
- Export logs## Requirements
- Swift 5.9+ (Xcode 15+)
- iOS 13+, macOS 10.15+## Installation
Install using Swift Package Manager
```swift
dependencies: [
.package(url: "https://github.com/0xWDG/OSLogViewer.git", branch: "main"),
],
targets: [
.target(name: "MyTarget", dependencies: [
.product(name: "OSLogViewer", package: "OSLogViewer"),
]),
]
```And import it:
```swift
import OSLogViewer
```## Usage
### Quick usage
```swift
import OSLogViewerNavigationLink {
// Default configuration
// uses your app's bundle identifier as subsystem
// and shows all logs from the last hour.
OSLogViewer()
} label: {
Text("View logs")
}
```### Custom usage
custom subsystem
```swift
import OSLogViewerOSLogViewer(
subsystem: "nl.wesleydegroot.exampleapp",
)
```custom time
```swift
import OSLogViewerOSLogViewer(
since: Date().addingTimeInterval(-7200) // 2 hours
)
```custom subsystem and time
```swift
import OSLogViewerOSLogViewer(
subsystem: "nl.wesleydegroot.exampleapp",
since: Date().addingTimeInterval(-7200) // 2 hours
)
```## Screenshots
## Export example
```plaintext
This is the OSLog archive for exampleapp
Generated on 2/6/2024, 11:53
Generator https://github.com/0xWDG/OSLogViewerInfo message
âšī¸ 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategoryError message
â 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategoryError message
â 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategoryCritical message
âŧī¸ 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategoryLog message
đ 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategoryLog message
đ 2/6/2024, 11:53 đī¸ exampleapp âī¸ nl.wesleydegroot.exampleapp đ myCategory
```## Changelog
- 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.## Contact
We can get in touch via [Twitter/X](https://twitter.com/0xWDG), [Discord](https://discordapp.com/users/918438083861573692), [Mastodon](https://mastodon.social/@0xWDG), [Email](mailto:[email protected]), [Website](https://wesleydegroot.nl).