nihulus
nihulus

Reputation: 1495

How to disable websocket writing debug message

Is there a way to disable debug - websocket writing 5::: message that constantly come up in the console when the websocket sending something, the message is being to chatty.

Upvotes: 5

Views: 7539

Answers (3)

ShadowGames
ShadowGames

Reputation: 1307

This is no more up to date.

According to http://socket.io/docs/logging-and-debugging you have to use the debugging scope

DEBUG=* node yourfile.js

in order to output debugging messages.

However, for a example, when I have "chat_server.js" and apply

DEBUG=* node chat_server.js

then Node.js tells me:

DEBUG=* node chat_server.js ^ SyntaxError: Unexpected token *

Anyone having an idea why scope '*' is not accepted?

Upvotes: 0

Ajey
Ajey

Reputation: 8202

include this in the app.js where you have server code

io.set('log level', 1);

Upvotes: 1

freakish
freakish

Reputation: 56467

You have to set log level on socket.io instance:

io.set('log level', 1);

Lower number will give you less info ( with 0 I guess none? ).

Upvotes: 13

Related Questions