Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

3. Custom Log Output Format Parsing

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

If you want to customize the log output content, you can conform the type to the LogContent protocol. For example, to print only the path of a URL type, simply define the logStringValue property as shown below:

extension URL: LogContent {
 public var logStringValue: String {
 return self.path
 }
}

By default, DDLoggerSwift converts Dictionary and Array types to JSON format. If you need to customize the output for other types, implement the LogContent protocol accordingly.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /