Skip to content

Commit 12b9017

Browse files
authored
Remove unneeded metadata additions (#169)
1 parent dfcf862 commit 12b9017

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

Sources/APNSwift/APNSClient.swift

+3-26
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,7 @@ extension APNSClient {
319319
logger[metadataKey: LoggingKeys.notificationTopic] = "\(topic ?? "nil")"
320320
logger[metadataKey: LoggingKeys.notificationCollapseID] = "\(collapseID ?? "nil")"
321321

322-
logger.debug(
323-
"APNSClient sending notification request"
324-
)
322+
logger.debug("APNSClient sending notification request")
325323

326324
let response = try await self.httpClient.execute(
327325
request,
@@ -332,17 +330,7 @@ extension APNSClient {
332330
let apnsID = response.headers.first(name: "apns-id").flatMap { UUID(uuidString: $0) }
333331

334332
if response.status == .ok {
335-
logger.trace(
336-
"APNSClient notification sent",
337-
metadata: [
338-
LoggingKeys.notificationPushType: "\(pushType)",
339-
LoggingKeys.notificationID: "\(apnsID?.description ?? "nil")",
340-
LoggingKeys.notificationExpiration: "\(expiration?.description ?? "nil")",
341-
LoggingKeys.notificationPriority: "\(priority?.description ?? "nil")",
342-
LoggingKeys.notificationTopic: "\(topic ?? "nil")",
343-
LoggingKeys.notificationCollapseID: "\(collapseID ?? "nil")",
344-
]
345-
)
333+
logger.trace("APNSClient notification sent")
346334
return APNSResponse(apnsID: apnsID)
347335
}
348336

@@ -358,18 +346,7 @@ extension APNSClient {
358346
line: line
359347
)
360348

361-
logger.debug(
362-
"APNSClient sending notification failed",
363-
metadata: [
364-
LoggingKeys.notificationPushType: "\(pushType)",
365-
LoggingKeys.notificationID: "\(apnsID?.description ?? "nil")",
366-
LoggingKeys.notificationExpiration: "\(expiration?.description ?? "nil")",
367-
LoggingKeys.notificationPriority: "\(priority?.description ?? "nil")",
368-
LoggingKeys.notificationTopic: "\(topic ?? "nil")",
369-
LoggingKeys.notificationCollapseID: "\(collapseID ?? "nil")",
370-
LoggingKeys.error: "\(error)",
371-
]
372-
)
349+
logger.debug("APNSClient sending notification failed")
373350

374351
throw error
375352
}

0 commit comments

Comments
 (0)