better log messages

This commit is contained in:
Unitech 2016-03-28 19:14:01 +02:00
parent 78eae77834
commit 3f3e0567d2

View File

@ -126,12 +126,15 @@ var Daemon = {
port : self.opts.ROOT_PORT
}, function(error) {
if (error && error.code == 'EAI_AGAIN') {
if (self.opts._connection_is_up == true)
console.error('[CRITICAL] Dameon cannot PING %s', self.opts.ROOT_URL, self.opts.ROOT_PORT);
self.opts._connection_is_up = false;
console.error('[CRITICAL] Dameon cannot PING %s', self.opts.ROOT_URL, self.opts.ROOT_PORT);
console.error('[CRITICAL] Disabling data push');
}
else
else {
if (self.opts._connection_is_up == false)
console.log('[TENTATIVE] Reactivating connection');
self.opts._connection_is_up = true;
}
if (error)
debug(error);