Skip to content

Commit

Permalink
net: revert logger changes
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonf committed May 17, 2019
1 parent f68ee32 commit eaec74a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/net/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,25 +421,25 @@ class Pool extends EventEmitter {

let wan;
try {
this.logger.debug('Discovering internet gateway via UPNP.');
this.logger.debug('Discovering internet gateway (upnp).');
wan = await UPNP.discover();
} catch (e) {
this.logger.debug('Could not discover internet gateway via UPNP ' +
'(reason=%s).', e.message);
this.logger.debug('Could not discover internet gateway (upnp).');
this.logger.debug(e);
return false;
}

let host;
try {
host = await wan.getExternalIP();
} catch (e) {
this.logger.debug('Could not find external IP via UPNP (reason=%s).',
e.message);
this.logger.debug('Could not find external IP (upnp).');
this.logger.debug(e);
return false;
}

if (this.hosts.addLocal(host, src, scores.UPNP))
this.logger.info('External IP found via UPNP (host=%s).', host);
this.logger.info('External IP found (upnp): %s.', host);

this.logger.debug(
'Adding port mapping %d->%d.',
Expand All @@ -448,8 +448,8 @@ class Pool extends EventEmitter {
try {
await wan.addPortMapping(host, src, dest);
} catch (e) {
this.logger.debug('Could not add port mapping via UPNP (reason=%s).',
e.message);
this.logger.debug('Could not add port mapping (upnp).');
this.logger.debug(e);
return false;
}

Expand Down Expand Up @@ -523,24 +523,24 @@ class Pool extends EventEmitter {
try {
host4 = await dns.getIPv4(2000);
} catch (e) {
this.logger.debug('Could not find external IPv4 via DNS (reason=%s).',
e.message);
this.logger.debug('Could not find external IPv4 (dns).');
this.logger.debug(e);
}

if (host4 && this.hosts.addLocal(host4, port, scores.DNS))
this.logger.info('External IPv4 found via DNS (host4=%s).', host4);
this.logger.info('External IPv4 found (dns): %s.', host4);

let host6 = null;

try {
host6 = await dns.getIPv6(2000);
} catch (e) {
this.logger.debug('Could not find external IPv6 via DNS (reason=%s).',
e.message);
this.logger.debug('Could not find external IPv6 (dns).');
this.logger.debug(e);
}

if (host6 && this.hosts.addLocal(host6, port, scores.DNS))
this.logger.info('External IPv6 found via DNS (host6=%s).', host6);
this.logger.info('External IPv6 found (dns): %s.', host6);
}

/**
Expand Down Expand Up @@ -1119,7 +1119,7 @@ class Pool extends EventEmitter {
};

peer.on('error', (err) => {
this.logger.debug(err.message);
this.logger.debug(err);
});

peer.once('connect', () => {
Expand Down Expand Up @@ -2437,7 +2437,7 @@ class Pool extends EventEmitter {
} catch (err) {
if (err.type === 'VerifyError') {
peer.reject('tx', err);
this.logger.info(err.message);
this.logger.info(err);
return;
}
throw err;
Expand Down

0 comments on commit eaec74a

Please sign in to comment.