Categories
JavaScript Answers

How to remove debugging from socket.io?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *