feat: 接入拍摄任务实时订阅并完善日志与封面
This commit is contained in:
@@ -430,7 +430,7 @@ final class APIClient {
|
||||
}
|
||||
let method = request.httpMethod ?? "REQUEST"
|
||||
let url = request.url?.absoluteString ?? "<invalid url>"
|
||||
var lines = ["[API][Request] \(method) \(url)"]
|
||||
var lines = ["\(APIConsoleFormat.prefix("Request", path: request.url?.path ?? "")) \(method) \(url)"]
|
||||
if let headers = request.allHTTPHeaderFields, !headers.isEmpty {
|
||||
lines.append("headers: " + DroneDockDiagnostics.json(headers))
|
||||
}
|
||||
@@ -469,7 +469,7 @@ final class APIClient {
|
||||
let headers = (response as? HTTPURLResponse)?.allHeaderFields.reduce(into: [String: String]()) {
|
||||
$0[String(describing: $1.key)] = String(describing: $1.value)
|
||||
} ?? [:]
|
||||
debugLogSink("[API][Response] \(method) \(url) status=\(statusCode)\nheaders: \(DroneDockDiagnostics.json(headers))\n\(body)")
|
||||
debugLogSink("\(APIConsoleFormat.prefix("Response", path: request.url?.path ?? "")) \(method) \(url) status=\(statusCode)\nheaders: \(DroneDockDiagnostics.json(headers))\n\(body)")
|
||||
}
|
||||
|
||||
/// Debug/Release 均记录取消,取消不记作成功响应或网络失败。
|
||||
@@ -480,7 +480,7 @@ final class APIClient {
|
||||
}
|
||||
let method = request.httpMethod ?? "REQUEST"
|
||||
let url = request.url?.absoluteString ?? "<invalid url>"
|
||||
debugLogSink("[API][Cancelled] \(method) \(url) reason=\(reason)")
|
||||
debugLogSink("\(APIConsoleFormat.prefix("Cancelled", path: request.url?.path ?? "")) \(method) \(url) reason=\(reason)")
|
||||
}
|
||||
|
||||
/// 所有业务模块均记录传输、业务拒绝或解码失败;保留显式模块日志策略。
|
||||
@@ -490,7 +490,7 @@ final class APIClient {
|
||||
debugLogSink(APIRedactedLog.event("Failure", for: request, category: category)
|
||||
+ " error=\(error.domain)(\(error.code))")
|
||||
} else {
|
||||
debugLogSink("[API][Failure] \(request.httpMethod ?? "REQUEST") \(request.url?.absoluteString ?? "<invalid url>")"
|
||||
debugLogSink("\(APIConsoleFormat.prefix("Failure", path: request.url?.path ?? "")) \(request.httpMethod ?? "REQUEST") \(request.url?.absoluteString ?? "<invalid url>")"
|
||||
+ " error=\(error.domain)(\(error.code)) message=\(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user