laggingreflex
laggingreflex

Reputation: 34627

How to disable socket.io 1.0 debugging?

I've upgraded to socket.io 1.0 which now uses visionmedia/debug

https://i.sstatic.net/AuGoz.png

It shows those messages even after SET DEBUG=-*

Upvotes: 3

Views: 8084

Answers (3)

Tejas
Tejas

Reputation: 358

  1. Go to node_modules folder
  2. inside to open socket.io folder

    enter image description here

  3. Click and open manager.js

     function Manager (server, options) {
        this.server = server;
        this.namespaces = {};
        this.sockets = this.of('');
        this.settings = {
        origins: '*:*', 
        log: false, 
        store: new MemoryStore, 
        logger: new Logger, 
        static: new Static(this), 
        heartbeats: true, 
        resource: '/socket.io', 
        transports: defaultTransports, 
        authorization: false, 
        blacklist: ['disconnect'], 
        'log level': 1, 
        'log colors': tty.isatty(process.stdout.fd)
      };
    

    set log to false

    Buzinga done :-)

Upvotes: -1

GillesC
GillesC

Reputation: 10874

You can set the log level when configuring socket.io (version < .1.0).

Setting it to 0 will only outpout in the console on error. You could also use your own logger and have it disabled.

log level defaults to 3

The amount of detail that the server should output to the logger.

0 - error

1 - warn

2 - info

3 - debug

Socket.io 1.0+

Note that the logger confirmation has changed please see the log differences and it is now using the debug module.

Upvotes: 2

Anubian Noob
Anubian Noob

Reputation: 13596

You can set the log level as described in the documentation.

io  = require('socket.io').listen(app);
io.set('log level',0);
  • 0 - error
  • 1 - warn
  • 2 - info
  • 3 - debug

Upvotes: 1

Related Questions