From 22f6226ae2c8922f2bf48dbbfc78ad93979b4b07 Mon Sep 17 00:00:00 2001 From: dernasherbrezon Date: Sat, 30 Dec 2023 00:11:25 +0000 Subject: [PATCH] better logging --- src/main/java/ru/r2cloud/device/LoraAtBleDevice.java | 2 +- .../java/ru/r2cloud/lora/loraat/gatt/LoraAtDeviceStatus.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/r2cloud/device/LoraAtBleDevice.java b/src/main/java/ru/r2cloud/device/LoraAtBleDevice.java index c9ce39e2..903f9e09 100644 --- a/src/main/java/ru/r2cloud/device/LoraAtBleDevice.java +++ b/src/main/java/ru/r2cloud/device/LoraAtBleDevice.java @@ -62,7 +62,7 @@ public DeviceStatus getStatus() { //TODO update rrd graphs public void updateStatus(LoraAtDeviceStatus status) { - LOG.info("[{}] signal: {}", id, status.getBluetoothRssi()); + LOG.info("[{}] status: {}", id, status.toString()); this.batteryLevel = null; this.signalLevel = status.getBluetoothRssi(); } diff --git a/src/main/java/ru/r2cloud/lora/loraat/gatt/LoraAtDeviceStatus.java b/src/main/java/ru/r2cloud/lora/loraat/gatt/LoraAtDeviceStatus.java index ad5d89a6..a892a123 100644 --- a/src/main/java/ru/r2cloud/lora/loraat/gatt/LoraAtDeviceStatus.java +++ b/src/main/java/ru/r2cloud/lora/loraat/gatt/LoraAtDeviceStatus.java @@ -57,4 +57,9 @@ public void setBatteryCurrent(int batteryCurrent) { this.batteryCurrent = batteryCurrent; } + @Override + public String toString() { + return "bluetoothRssi=" + bluetoothRssi + ", sx127xRawTemperature=" + sx127xRawTemperature + ", solarVoltage=" + solarVoltage + ", solarCurrent=" + solarCurrent + ", batteryVoltage=" + batteryVoltage + ", batteryCurrent=" + batteryCurrent; + } + }