Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable debug messages on sockjs- STOMP

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

like image 973
J.R. Avatar asked Sep 05 '14 09:09

J.R.


2 Answers

Ok I found a solution.

I added this code:

stompClient.debug = null

In this way, the debug function is disabled.

like image 128
J.R. Avatar answered Nov 16 '22 00:11

J.R.


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

stompClient.debug = () => {};
like image 47
PaulB Avatar answered Nov 16 '22 01:11

PaulB