node.js 如何从 Express 应用程序中删除调试?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6807775/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove debugging from an Express app?
提问by Vsplit
I would like to remove the debugging mode. I am using express, redis, socket.ioand connect-redis, but I do not know where the debugging mode comes from.
我想删除调试模式。我正在使用express, redis,socket.io和connect-redis,但我不知道调试模式来自哪里。


Someone has an idea?
有人有想法吗?
回答by Alfred
Update
更新
To completely remove debugging use:
要完全删除调试使用:
var io = require('socket.io').listen(app, { log: false });
Where appis node.js http server / express etc.
appnode.js http server / express 等在哪里?
You forgot to mention you are also using socket.io. This is coming from socket.io. You can disable this by configuration:
你忘了提到你也在使用socket.io。这是来自socket.io。您可以通过配置禁用此功能:
io.set('log level', 1); // reduce logging

