Reduce amount of logging
This commit is contained in:
parent
ad1c959ead
commit
7968f64581
@ -92,7 +92,6 @@ final class DeviceManager {
|
|||||||
|
|
||||||
// Check if a full message has already been received
|
// Check if a full message has already been received
|
||||||
if let receivedMessageData, receivedMessageData.count == SignedMessage.size {
|
if let receivedMessageData, receivedMessageData.count == SignedMessage.size {
|
||||||
log("[INFO] Full message from socket collected early")
|
|
||||||
self.receivedMessageData = nil
|
self.receivedMessageData = nil
|
||||||
return receivedMessageData
|
return receivedMessageData
|
||||||
}
|
}
|
||||||
@ -101,14 +100,13 @@ final class DeviceManager {
|
|||||||
self.requestInProgress = continuation
|
self.requestInProgress = continuation
|
||||||
}
|
}
|
||||||
await updateMessageCountMetric()
|
await updateMessageCountMetric()
|
||||||
log("[INFO] Message completed")
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private func startTimeoutForDeviceRequest(on eventLoop: EventLoop) {
|
private func startTimeoutForDeviceRequest(on eventLoop: EventLoop) {
|
||||||
eventLoop.scheduleTask(in: .seconds(deviceTimeout)) { [weak self] in
|
eventLoop.scheduleTask(in: .seconds(deviceTimeout)) { [weak self] in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
log("[INFO] No reference to self after timeout of message")
|
log("[WARN] No reference to self after timeout of message")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.resumeDeviceRequest(with: .deviceTimedOut)
|
self.resumeDeviceRequest(with: .deviceTimedOut)
|
||||||
@ -143,7 +141,6 @@ final class DeviceManager {
|
|||||||
|
|
||||||
private func resumeDeviceRequest(with result: MessageResult) {
|
private func resumeDeviceRequest(with result: MessageResult) {
|
||||||
guard let receivedMessageData else {
|
guard let receivedMessageData else {
|
||||||
log("[WARN] Result after message completed: \(result)")
|
|
||||||
self.requestInProgress = nil
|
self.requestInProgress = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -163,13 +160,7 @@ final class DeviceManager {
|
|||||||
|
|
||||||
func processDeviceResponse(_ buffer: ByteBuffer) {
|
func processDeviceResponse(_ buffer: ByteBuffer) {
|
||||||
guard let data = buffer.getData(at: 0, length: buffer.readableBytes) else {
|
guard let data = buffer.getData(at: 0, length: buffer.readableBytes) else {
|
||||||
log("Failed to get data buffer received from device")
|
log("[WARN] Failed to get data buffer received from device")
|
||||||
self.resumeDeviceRequest(with: .invalidMessageSizeFromDevice)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
guard data.count == SignedMessage.size else {
|
|
||||||
log("Invalid size of device message: \(data.count)")
|
|
||||||
self.resumeDeviceRequest(with: .invalidMessageSizeFromDevice)
|
self.resumeDeviceRequest(with: .invalidMessageSizeFromDevice)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -227,7 +218,6 @@ final class DeviceManager {
|
|||||||
self.didCloseDeviceSocket()
|
self.didCloseDeviceSocket()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log("[INFO] Socket connected")
|
|
||||||
await updateDeviceConnectionMetrics()
|
await updateDeviceConnectionMetrics()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user