diff --git a/src/main/java/ch/hevs/isi/db/DatabaseConnector.java b/src/main/java/ch/hevs/isi/db/DatabaseConnector.java index 63eb65a..5a2bbc0 100644 --- a/src/main/java/ch/hevs/isi/db/DatabaseConnector.java +++ b/src/main/java/ch/hevs/isi/db/DatabaseConnector.java @@ -163,7 +163,7 @@ public class DatabaseConnector implements DataPointListener { if(respondCode != 204){ System.out.println("Error: " + respondCode + ", Data: " + data); } else { - System.out.println(data + " -> Database"); + Utility.pDebug(data + " -> Database"); } con.disconnect(); con = null; diff --git a/src/main/java/ch/hevs/isi/field/FieldConnector.java b/src/main/java/ch/hevs/isi/field/FieldConnector.java index 5b5b9c1..26b00a1 100644 --- a/src/main/java/ch/hevs/isi/field/FieldConnector.java +++ b/src/main/java/ch/hevs/isi/field/FieldConnector.java @@ -3,6 +3,7 @@ package ch.hevs.isi.field; import ch.hevs.isi.core.DataPoint; import ch.hevs.isi.core.DataPointListener; import ch.hevs.isi.core.FloatDataPoint; +import ch.hevs.isi.utils.Utility; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -89,7 +90,7 @@ public class FieldConnector implements DataPointListener { } private void pushToField(String label, String value){ - System.out.println("Field: " + label + " " + value); + Utility.pDebug("Field: " + label + " " + value); } @Override public void onNewValue(DataPoint dp) { diff --git a/src/main/java/ch/hevs/isi/web/WebConnector.java b/src/main/java/ch/hevs/isi/web/WebConnector.java index 9b6f119..292dfab 100644 --- a/src/main/java/ch/hevs/isi/web/WebConnector.java +++ b/src/main/java/ch/hevs/isi/web/WebConnector.java @@ -4,6 +4,7 @@ import ch.hevs.isi.core.BooleanDataPoint; import ch.hevs.isi.core.DataPoint; import ch.hevs.isi.core.DataPointListener; import ch.hevs.isi.core.FloatDataPoint; +import ch.hevs.isi.utils.Utility; import org.java_websocket.WebSocket; import org.java_websocket.handshake.ClientHandshake; import org.java_websocket.server.WebSocketServer; @@ -50,7 +51,7 @@ public class WebConnector implements DataPointListener { @Override public void onMessage(WebSocket conn, String message) { - System.out.println("received message from " + conn.getRemoteSocketAddress() + ": " + message); + Utility.pDebug("received message from " + conn.getRemoteSocketAddress() + ": " + message); updateDataPoint(message); } @@ -74,15 +75,15 @@ public class WebConnector implements DataPointListener { private void pushToWeb(DataPoint dp){ wss.broadcast(dp.toString()); - System.out.println(dp.toString() + " -> Web"); + Utility.pDebug(dp.toString() + " -> Web"); } private void updateDataPoint(String message){ String label = message.split("=")[0]; - System.out.println("Label: " + label); + Utility.pDebug("Label: " + label); String value = message.split("=")[1]; - System.out.println("Value: " + value); + Utility.pDebug("Value: " + value); if( (value.equals("true")) || value.equals("false") ) { new BooleanDataPoint(label, true).setValue(Boolean.parseBoolean(value));