OSLogViewer

1.1.3

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.
0xWDG/OSLogViewer

What's New

1.1.3

2025-04-17T20:47:15Z

Datarace improvements

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.

Swift Package Manager License

Key features:

  • View your apps OS_Log history
  • Export logs

Requirements

  • Swift 5.8+ (Xcode 14.3+)
  • iOS 16+, macOS 12+, watchOS 9+, tvOS 16+, visionOS 1+

Installation

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

Usage

Quick usage

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 usage

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
)

Screenshots

Export example

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

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.
  • 1.0.2 & 1.0.3
    • Fix: building on macOS < 14.
    • Improved support for dark mode.
    • Colors are more similar to Xcode's console.
    • Added support for exporting logs.
  • 1.0.4
    • Fix: building on all platforms other than iOS.
    • Improved support for dark mode.
    • Colors are more similar to Xcode's console.
    • Added support for exporting logs.
    • Added online documentation https://0xwdg.github.io/OSLogViewer/
  • 1.0.5
    • Improve text alignment and word-breaks in the details
  • 1.0.7
    • Multi platform support
  • 1.0.8
    • Fix hang on loading data
  • 1.1.0
    • Added OSLogExtractor
  • 1.1.1
    • Fixes for Linux targets
  • 1.1.2
    • Fix logs on Mac displaying incorrectly by @infinitepower18 in #2
  • 1.1.3
    • Make datarace safe

Contact

๐Ÿฆ‹ @0xWDG ๐Ÿ˜ mastodon.social/@0xWDG ๐Ÿฆ @0xWDG ๐Ÿงต @0xWDG ๐ŸŒ wesleydegroot.nl ๐Ÿค– Discord

Interested learning more about Swift? Check out my blog.

Description

  • Swift Tools 5.8.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun May 04 2025 01:23:30 GMT-0900 (Hawaii-Aleutian Daylight Time)