mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
closes #689
This commit is contained in:
@@ -125,6 +125,14 @@ var socket,
|
||||
socket.on('meta.updateHeader', app.updateHeader);
|
||||
|
||||
app.enterRoom('global');
|
||||
|
||||
if (config.environment === 'development' && console && console.log) {
|
||||
var log = console.log;
|
||||
console.log = function() {
|
||||
log.apply(this, arguments);
|
||||
socket.emit('tools.log', arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async: false
|
||||
|
||||
9
src/socket.io/tools.js
Normal file
9
src/socket.io/tools.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var winston = require('winston');
|
||||
|
||||
var SocketTools = {};
|
||||
|
||||
SocketTools.log = function(socket, data, callback) {
|
||||
winston.info("captured console.log:", data)
|
||||
};
|
||||
|
||||
module.exports = SocketTools;
|
||||
Reference in New Issue
Block a user