Sometimes, we want to remove debugging from socket.io.
In this article, we’ll look at how to remove debugging from socket.io.
How to remove debugging from socket.io?
To remove debugging from socket.io, we can set the log option to false when we call listen.
For instance, we write
const io = require('socket.io').listen(app, {
log: false
});
to call listen with log set to false to disable logging with socket.io.
We can also set the log level with
const io = require('socket.io').listen(app);
io.set('log level', 1);
to set log level to 1 to reduce the level of logging.
Conclusion
To remove debugging from socket.io, we can set the log option to false when we call listen.