Guard logging with LOG.isDebugEnabled()

here
cpfeiffer 2015-10-19 20:48:39 +02:00
parent 4096e50681
commit 5a3990b9d2
1 changed files with 6 additions and 4 deletions

View File

@ -409,11 +409,13 @@ public final class BtLEQueue {
@Override
public void onCharacteristicChanged(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic) {
String content = "";
for (byte b : characteristic.getValue()) {
content += String.format(" 0x%1x", b);
if (LOG.isDebugEnabled()) {
String content = "";
for (byte b : characteristic.getValue()) {
content += String.format(" 0x%1x", b);
}
LOG.debug("characteristic changed: " + characteristic.getUuid() + " value: " + content );
}
LOG.debug("characteristic changed: " + characteristic.getUuid() + " value: " + content );
if (!checkCorrectGattInstance(gatt, "characteristic changed")) {
return;
}