added more logging
This commit is contained in:
parent
24730138e7
commit
de187ba872
10
lib/node.js
10
lib/node.js
@ -277,6 +277,8 @@ Node.prototype.emit = function(message, payload)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
socket.emit(message, payload);
|
socket.emit(message, payload);
|
||||||
|
console.success('wsc', 'Socket emited message:', chalk.reset.cyan(message));
|
||||||
|
console.success('wsc', payload);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error('wsc', 'Socket emit error:', err);
|
console.error('wsc', 'Socket emit error:', err);
|
||||||
@ -502,7 +504,7 @@ Node.prototype.getHistory = function (range)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('history', {
|
self.emit('history', {
|
||||||
id: self.id,
|
id: self.id,
|
||||||
history: results.reverse()
|
history: results.reverse()
|
||||||
});
|
});
|
||||||
@ -540,14 +542,16 @@ Node.prototype.prepareStats = function ()
|
|||||||
|
|
||||||
Node.prototype.sendUpdate = function (force)
|
Node.prototype.sendUpdate = function (force)
|
||||||
{
|
{
|
||||||
if( this.changed() || force )
|
if( this.changed() || force ) {
|
||||||
|
console.info("wsc", "Sending", chalk.reset.blue((force ? "forced" : "changed")), chalk.bold.white("update"));
|
||||||
this.emit('update', this.prepareStats());
|
this.emit('update', this.prepareStats());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node.prototype.ping = function()
|
Node.prototype.ping = function()
|
||||||
{
|
{
|
||||||
this._latency = _.now();
|
this._latency = _.now();
|
||||||
this.emit('node-ping', { id: this.id });
|
socket.emit('node-ping', { id: this.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
Node.prototype.setWatches = function()
|
Node.prototype.setWatches = function()
|
||||||
|
Loading…
Reference in New Issue
Block a user