Enabling and disabling log printing in the SubscriptionMessagesHub

develop
Nelson R. Perez 2018-02-01 12:02:03 -05:00
parent f186bbe7b9
commit 2da04adfea
1 changed files with 10 additions and 1 deletions

View File

@ -61,6 +61,7 @@ public class SubscriptionMessagesHub extends BaseGrapheneHandler implements Subs
private int subscriptionCounter = 0;
private HashMap<Long, BaseGrapheneHandler> mHandlerMap = new HashMap<>();
private List<BaseGrapheneHandler> 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<Serializable> 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;
}
}