Skip to content

TheFern2/NSWatchLogViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSWatchLogViewer

A macOS app for viewing structured logs streamed from watchOS apps in real time. Receives log entries over HTTP, advertises via Bonjour, and displays them in a sortable, filterable table.

Built to pair with the NSWatchLogger library.

Features

  • Real-time log streaming over HTTP
  • Bonjour advertising (_watchlog._tcp)
  • Filter by log level (debug, info, warning, error)
  • Filter by tag (network, workout, service, debug, or custom)
  • Full-text search across messages and tags
  • Sortable columns (time, tag, level, message)
  • Session tracking with device name and entry count
  • Detail pane with full message text and metadata
  • Export filtered logs as JSON or plain text
  • Auto-scroll to latest entries
  • Connected client list with endpoint info

Requirements

  • macOS 14.0 (Sonoma) or later

Setup

  1. Open NSWatchLogViewer.xcodeproj in Xcode
  2. Build and run
  3. The server starts automatically on port 9830 and advertises via Bonjour

On the watchOS side, configure DirectLogTransport with the Mac's IP address:

import NSWatchLogger
import NSWatchLoggerDirect

let transport = DirectLogTransport.create(host: "192.168.1.50")
WatchLogger.configure(transport: transport, enabled: true)

WatchLogger.log(.network, .info, "Connected to server")

The host IP must be provided explicitly because watchOS blocks Bonjour discovery via NECP policy.

UI Layout

Sidebar — Server status indicator, Bonjour advertisement status, connected clients, and session list with device names.

Log Table — Sortable table with timestamp (millisecond precision), color-coded tag badges, level icons, and truncated messages.

Detail Pane — Full message text, timestamp, tag, level, session ID, and device name for the selected entry. Message text is selectable and copyable.

Toolbar — Level filter toggles, tag filter menu, search bar, export menu, auto-scroll toggle, and clear button.

Configuration

The port defaults to 9830. Auto-scroll is enabled by default. Both settings persist across launches.

Dependencies

Uses the following products from NSWatchLogger:

  • NSWatchLoggerServer — HTTP listener and Bonjour advertising
  • NSWatchLoggerModels — Shared LogEntry type and Bonjour constants

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages