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.
Asked
Active
Viewed 7,165 times
5

nihulus
- 1,475
- 4
- 24
- 46
-
duplicate: http://stackoverflow.com/questions/6807775/socket-io-remove-debug-mode (OP didn't explicitly mention s/he is using socket.io, but the question tagged as such, and the accepted answer refers to socket.io.) – ericsoco Jun 26 '13 at 22:16
-
I find this question better than the linked duplicate, as it applies solely to socket.io, the linked question has other frameworks involved. – RozzA Dec 08 '13 at 08:10
3 Answers
13
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? ).

freakish
- 54,167
- 9
- 132
- 169
0
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?

ShadowGames
- 1,110
- 1
- 10
- 15
-
That looks like good syntax if you're running on a Linux based system. Any chance that you're using Windows? – Guy Aug 27 '15 at 17:30