How to disable debug messages on sockjs- STOMP

JavascriptWebsocketSocksStomp

Javascript Problem Overview


I have the follow situation:

 var options = {
	    protocols_whitelist : [ "websocket", "xhr-streaming", "xdr-streaming", "xhr-polling", "xdr-polling", "iframe-htmlfile", "iframe-eventsource", "iframe-xhr-polling" ],
	    debug : false
	};

	var socket = new SockJS("/mmyurl/",undefined,options);
	var stompClient = Stomp.over(socket);
	stompClient.connect({
	    company : "XXXXX"
	}, function(frame) {
	    stompClient.subscribe('/topic/mytopic', function(message){ 
	    	var myitem = JSON.parse(message.body);
	    	
	    });

all works fine, the problem is that on the javascript console is full of debug messages like this:

<<< MESSAGE
content-type:application/json;charset=UTF-8
subscription:sub-1
message-id:o6g660dt-113
destination:/topic/mytopic
content-length:411

And I want to disable the messages.

I tried to change some option and also tried to register simply:

var socket = new SockJS("/mmyurl/");

but it doesn't work.

Is there a way to disable the debug messages?

Any help is appreciated

Javascript Solutions


Solution 1 - Javascript

Ok I found a solution.

I added this code:

stompClient.debug = null

In this way, the debug function is disabled.

Solution 2 - Javascript

I tried JR's answer but started receiving errors (was using redux sagas) - changing debug to an empty function worked ...

stompClient.debug = () => {};

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJ.R.View Question on Stackoverflow
Solution 1 - JavascriptJ.R.View Answer on Stackoverflow
Solution 2 - JavascriptPaulBView Answer on Stackoverflow