DDLoggerSwift is an iOS library that displays log output as a floating overlay on the screen. It allows easy logging and supports log file sharing and uploading, making it convenient for debugging on a real device without an Xcode connection. Users can share and filter logs effortlessly.
This project uses SQLite for efficient log storage while ensuring insertion order. It does not affect UI performance or interactions, ensuring high runtime efficiency.Automatically converts Array
and Dictionary
into JSON strings for display.
Preview GIF picture | Xcode debug GIF |
---|---|
![]() |
![]() |
You can install DDLoggerSwift using CocoaPods or manually by downloading the source files and adding them to your project.
Add the following line to your Podfile
and run pod install
:
pod 'DDLoggerSwift'
Drag and drop the files from the pod
folder into your project.
import DDLoggerSwift
DDLoggerSwift.show()
There are five types of log outputs, each with different font colors.
printDebug(log) // Debug output, only visible in Xcode, not stored in the log database.
printLog(log) // Logs displayed in green.
printWarn(log) // Logs displayed in yellow.
printError(log) // Logs displayed in red.
printPrivacy(log) // Outputs encrypted data. Encryption details can be found in the encryption documentation.
✅ [2025-03-19T03:11:59Z] [INFO] File: TalkViewModel.swift | Line: 730 | Function: _bindRequest() |
---------------------------------
Log message
⚠️ [2025-03-19T03:11:59Z] [WARN] File: TalkViewModel.swift | Line: 730 | Function: _bindRequest() |
---------------------------------
Warning message
❌ [2025-03-19T03:11:59Z] [ERROR] File: TalkViewModel.swift | Line: 730 | Function: _bindRequest() |
---------------------------------
Error message
⛔️ [2025-03-19T03:11:59Z] [PRIVACY] File: TalkViewModel.swift | Line: 730 | Function: _bindRequest() |
---------------------------------
AAuKjIm5hC2jiPqz7OKHAngWspeACyWZufDguqdOcugituhWV8jnbr/6SHYoK0/9
💜 [2025-03-19T03:11:59Z] [DEBUG] File: TalkViewModel.swift | Line: 730 | Function: _bindRequest() |
---------------------------------
Test output, not stored in the database by default.
For advanced features such as file encryption, custom formats, file retrieval, and sharing, please refer to the wiki for a complete list and detailed instructions.
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.
After the 3.0.0
version, it can be used with the above log viewing tool to realize real-time log viewing on the local area network, and use the simple configuration interface
For local network real-time log viewing, refer to Log Viewing Client.
The project is based on the MIT License