Skip to content

Commit

Permalink
Disable api response logging for iOS <17 (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka authored Oct 23, 2023
1 parent 9c258ef commit b8a71db
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Zotero/Controllers/Debugging/ApiLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ struct ApiLogger {
if startData.logParams.contains(.headers) {
self.log(headers: headers ?? [:])
}
if startData.logParams.contains(.response), let data = data, var string = String(data: data, encoding: .utf8) {
if string.count > 5000 {
string = String(string.prefix(5000))
}
if #available(iOS 17.0, *), startData.logParams.contains(.response), let data = data, let string = String(data: data, encoding: .utf8) {
DDLogInfo(DDLogMessageFormat(stringLiteral: string))
}
}
Expand Down

0 comments on commit b8a71db

Please sign in to comment.