markbattistella/simpleloggerui
`SimpleLoggerUI` is a Swift package that provides a complete, ready-to-use SwiftUI interface for inspecting logs collected via the [`SimpleLogger`](https://github.com/markbattistella/SimpleLogger) package.
Features
- Log list screen
- Displays logs with timestamp, level, subsystem, category, and message - Visual styling adapts to log severity for improved scan-ability - Pull-to-refresh support
- Filtering
- Exclude system logs - Filter by: - Specific date - Date range - Hour range (within a single day) - Preset ranges (e.g. recent periods) - Filter by log level with multi-selection support
- Exporting
- Export formats: - Plain log - JSON - JSON Lines - CSV (configurable delimiter) - Optional gzip compression for file exports - Export to file system or copy directly to clipboard
- Cross-platform
- Adaptive navigation and toolbar behaviour - Native file exporter integration - macOS and iOS-appropriate interaction patterns
Installation
Add SimpleLoggerUI using Swift Package Manager.
dependencies: [
.package(
url: "https://github.com/markbattistella/SimpleLoggerUI",
from: "1.0.0"
)
]Alternatively, you can add SimpleLoggerUI using Xcode by navigating to File > Add Packages and entering the package repository URL.
Usage
LogListScreen
LogListScreen is the primary entry point. It manages fetching, filtering, and exporting logs internally using LoggerManager.
![IMPORTANT] You do not need to supply logs manually.
import SwiftUI
import SimpleLoggerUI
struct ContentView: View {
var body: some View {
NavigationStack {
LogListScreen()
}
}
}LogListScreen automatically:
- Fetches logs on appearance
- Supports pull-to-refresh
- Provides toolbar actions for filtering and exporting
- Displays loading and empty states
Filtering Logs
Tap Filter in the toolbar to open the filter sheet.
Available filter modes:
Specific date
View logs recorded on a single calendar day.
Date range
View logs across multiple days (inclusive).
Hour range
Select a date and restrict logs to a specific hour window.
Preset
Quickly apply commonly used time ranges.
You can also:
- Exclude system logs
- Select which log levels are visible
- Filter changes are applied immediately.
Exporting Logs
Tap Export in the toolbar to open the export sheet.
Export options
- Output formats:
- .log - .json - .jsonl - .csv
- CSV delimiter selection
- Optional gzip compression (file exports only)
Export destinations
- Export to file: Saves the export via the system file picker.
- Copy to clipboard: Copies UTF-8 text in the selected format (compression ignored).
Contributing
Contributions are welcome! Please fork the repository and submit a pull request for any features, fixes, or improvements.
License
SimpleLoggerUI is available under the MIT license. See the LICENCE file for more information.
Package Metadata
Repository: markbattistella/simpleloggerui
Default branch: main
README: README.md