Fix incorrect usage or log.XXX methods - replace String.format with log.XXX formatter
This commit is contained in:
parent
4a2e40fdb5
commit
a2b404788b
@ -205,8 +205,7 @@ class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcessor {
|
||||
saveRpcRequestToEdgeQueue(request, rpcRequest.getRequestId()).get();
|
||||
sent = true;
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
String errMsg = String.format("[%s][%s][%s] Failed to save rpc request to edge queue %s", tenantId, deviceId, edgeId.getId(), request);
|
||||
log.error(errMsg, e);
|
||||
log.error("[{}][{}][{}] Failed to save rpc request to edge queue {}", tenantId, deviceId, edgeId.getId(), request, e);
|
||||
}
|
||||
} else if (isSendNewRpcAvailable()) {
|
||||
sent = rpcSubscriptions.size() > 0;
|
||||
|
||||
@ -240,8 +240,7 @@ public class DefaultEdgeNotificationService implements EdgeNotificationService {
|
||||
}
|
||||
|
||||
private void callBackFailure(TransportProtos.EdgeNotificationMsgProto edgeNotificationMsg, TbCallback callback, Throwable throwable) {
|
||||
String errMsg = String.format("Can't push to edge updates, edgeNotificationMsg [%s]", edgeNotificationMsg);
|
||||
log.error(errMsg, throwable);
|
||||
log.error("Can't push to edge updates, edgeNotificationMsg [{}]", edgeNotificationMsg, throwable);
|
||||
callback.onFailure(throwable);
|
||||
}
|
||||
|
||||
|
||||
@ -625,8 +625,7 @@ public final class EdgeGrpcSession implements Closeable {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String errMsg = String.format("[%s] Can't process uplink msg [%s]", this.sessionId, uplinkMsg);
|
||||
log.error(errMsg, e);
|
||||
log.error("[{}] Can't process uplink msg [{}]", this.sessionId, uplinkMsg, e);
|
||||
return Futures.immediateFailedFuture(e);
|
||||
}
|
||||
return Futures.allAsList(result);
|
||||
|
||||
@ -100,8 +100,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor {
|
||||
try {
|
||||
newDevice = createDevice(tenantId, edge, deviceUpdateMsg, newDeviceName);
|
||||
} catch (DataValidationException e) {
|
||||
String errMsg = String.format("[%s] Device update msg can't be processed due to data validation [%s]", tenantId, deviceUpdateMsg);
|
||||
log.error(errMsg, e);
|
||||
log.error("[{}] Device update msg can't be processed due to data validation [{}]", tenantId, deviceUpdateMsg, e);
|
||||
return Futures.immediateFuture(null);
|
||||
}
|
||||
ObjectNode body = JacksonUtil.OBJECT_MAPPER.createObjectNode();
|
||||
@ -116,8 +115,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor {
|
||||
try {
|
||||
device = createDevice(tenantId, edge, deviceUpdateMsg, deviceUpdateMsg.getName());
|
||||
} catch (DataValidationException e) {
|
||||
String errMsg = String.format("[%s] Device update msg can't be processed due to data validation [%s]", tenantId, deviceUpdateMsg);
|
||||
log.error(errMsg, e);
|
||||
log.error("[{}] Device update msg can't be processed due to data validation [{}]", tenantId, deviceUpdateMsg, e);
|
||||
return Futures.immediateFuture(null);
|
||||
}
|
||||
return saveEdgeEvent(tenantId, edge.getId(), EdgeEventType.DEVICE, EdgeEventActionType.CREDENTIALS_REQUEST, device.getId(), null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user