如何在sockjs-STOMP上禁用调试消息 [英] How to disable debug messages on sockjs- STOMP

查看:2314
本文介绍了如何在sockjs-STOMP上禁用调试消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况:

 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);

        });

一切正常,问题是在javascript控制台上充满了这样的调试消息:

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

我想禁用这些消息。

我试图更改一些选项并尝试注册:

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

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

但它不起作用。

有没有办法禁用调试消息?

Is there a way to disable the debug messages?

感谢任何帮助

推荐答案

好的我找到了解决方案。

Ok I found a solution.

我添加了这段代码:

stompClient.debug = null

这样,调试功能被禁用。

In this way, the debug function is disabled.

这篇关于如何在sockjs-STOMP上禁用调试消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆