I have this Code in node
var io = require('socket.io'), connect = require('connect');
var pg = require('pg');
var connectionString = "Some connection string";
var app = connect().use(connect.static('public')).listen(3000);
var chat_room = io.listen(app);
var DataArrayRows=[];
setInterval(function(){
pg.connect(connectionString, function(err, client, done) {
client.query('select * from jctsl_get_all_notifications_v1()', function(err, result) {
DataArrayRows=result.rows;
done();
});
});
},10000);
chat_room.sockets.on('connection',function(socket){
chat_room.sockets.emit('entrance',{message:DataArrayRows});
setInterval(function(){
chat_room.sockets.emit('entrance',{message:DataArrayRows});
},10000);
});
In the code, I've not written any console.log()
statement but still on every request to database, the returned rows are displayed on the console window.
How can I stop node from doing that?
Set the log level lower
var chat_room = io.listen(app);
chat_room.set('log level', 0);
The log level defaults to 3
The amount of detail that the server should output to the logger.
0 - error
1 - warn
2 - info
3 - debug
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.