Skip to content

Commit

Permalink
Log sensor id along with sensor.community upload result
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrik committed Mar 16, 2024
1 parent c284ee9 commit 840b9b2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ private void performUpload(AppDeviceId appDeviceId, SensorData data) {

private void uploadMeasurement(ESensComPin pin, String sensorId, SensComMessage message) {
try {
LOG.info("Sending for {} to pin {}: '{}'", sensorId, pin, mapper.writeValueAsString(message));
LOG.info("Uploading for {} to pin {}: '{}'", sensorId, pin, mapper.writeValueAsString(message));
Response<String> response = restClient.pushSensorData(pin.getPin(), sensorId, message).execute();
if (response.isSuccessful()) {
LOG.info("Result success: {}", response.body());
LOG.info("Upload success for {}: {}", sensorId, response.body());
} else {
LOG.warn("Request failed: {} - {}", response.message(), response.errorBody().string());
LOG.warn("Upload failed for {}: {} - {}", sensorId, response.message(), response.errorBody().string());
}
} catch (IOException e) {
LOG.warn("Caught IOException: {}", e.getMessage());
LOG.warn("Caught IOException for {}: {}", sensorId, e.getMessage());
}
}

Expand Down

0 comments on commit 840b9b2

Please sign in to comment.