Skip to content

5. Log Viewing Client

Damon东哥 edited this page Mar 20, 2025 · 4 revisions

This library stores log information using SQLite. You can use any generic SQLite viewer or the DDLoggerClient client to view the SQLite files exported by DDLoggerSwift.

The client is developed using SwiftUI and is specifically designed to parse logs from DDLoggerSwift, making log viewing more convenient.

Real-time Log Viewing via Local Network (Beta)

Starting from version 3.0.0, real-time log viewing over a local network has been implemented, allowing easy configuration and usage.

1. Enable Local Network Logging in Your Project

Add the following pod to your project:

pod 'DDLoggerSwift/socket'

2. Configure info.plist for Local Network and Bonjour Services

Add the following keys to your info.plist file:

<key>NSBonjourServices</key>
	<array>
		<string>_DDLoggerSwift._tcp</string>
	</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Search for local network to enable Bonjour functionality</string>

Note: The type value in NSBonjourServices must match the DDLoggerSwift.socketType. You can customize socketType in DDLoggerSwift, but if you modify it, ensure that info.plist reflects the same change.

With this configuration, you can view logs from devices on the same local network using DDLoggerClient without any additional setup.

Clone this wiki locally