Skip to content

1. Installation

Damon东哥 edited this page Mar 20, 2025 · 1 revision

1. Installation

You can install DDLoggerSwift using CocoaPods or manually by downloading the source files and adding them to your project.

1.1 CocoaPods Installation

Add the following line to your Podfile and run pod install:

pod 'DDLoggerSwift'

1.2 Manual Installation

Drag and drop the files from the pod folder into your project.


2. Usage

1. Import the Framework

import DDLoggerSwift

2. Show the Floating Log Window

DDLoggerSwift.show()

3. Log Output

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.

4. Log Output Format

✅ [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.
Clone this wiki locally