diff --git a/graphenej/src/main/java/cy/agorise/graphenej/api/SubscriptionMessagesHub.java b/graphenej/src/main/java/cy/agorise/graphenej/api/SubscriptionMessagesHub.java index 1509be3..b6e3b43 100644 --- a/graphenej/src/main/java/cy/agorise/graphenej/api/SubscriptionMessagesHub.java +++ b/graphenej/src/main/java/cy/agorise/graphenej/api/SubscriptionMessagesHub.java @@ -61,6 +61,7 @@ public class SubscriptionMessagesHub extends BaseGrapheneHandler implements Subs private int subscriptionCounter = 0; private HashMap mHandlerMap = new HashMap<>(); private List pendingHandlerList = new ArrayList<>(); + private boolean printLogs; // State variables private boolean isUnsubscribing; @@ -141,7 +142,7 @@ public class SubscriptionMessagesHub extends BaseGrapheneHandler implements Subs @Override public void onTextFrame(WebSocket websocket, WebSocketFrame frame) throws Exception { String message = frame.getPayloadText(); - System.out.println("<< "+message); + if(printLogs) System.out.println("<< "+message); if(currentId == LOGIN_ID){ currentId = GET_DATABASE_ID; ArrayList emptyParams = new ArrayList<>(); @@ -316,4 +317,12 @@ public class SubscriptionMessagesHub extends BaseGrapheneHandler implements Subs } } } + + public void setPrintLogs(boolean printLogs){ + this.printLogs = printLogs; + } + + public boolean isPrintLogs(){ + return this.printLogs; + } }