Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#31522 from nullaus/bug1198172
Browse files Browse the repository at this point in the history
Bug 1198172 - Reduce logging noise for ease of debugging. r=me
  • Loading branch information
nullaus committed Aug 25, 2015
2 parents a8a462a + 81905b9 commit c1ae9f0
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ TcpSync.prototype.waitForSocket = function(options, callback) {
}

options = options || {};
var interval = options.interval || 0;
var interval = options.interval || 100;
var timeout = options.timeout || 30000;
var socketTimeout = 1000;

var sockit = new sockittome.Sockit();
var start = Date.now();
var lastDebugMessage = '';
var self = this;

// Use sockittome's built in polling timeout during calls to connect
Expand All @@ -82,7 +83,14 @@ TcpSync.prototype.waitForSocket = function(options, callback) {
}
}
catch(e) {
debug('exception when probing socket', e.message);
// This may seem ridiculous, but we have to keep these errors showing up
// but, they often repeat like CRAZY, so, quiet them down by only showing
// each exception we encounter once.
if (lastDebugMessage != e.message) {
lastDebugMessage = e.message;
debug('exception when probing socket', lastDebugMessage);
}

// Above read _may_ fail so it is important to close the socket...
sockit.close();
}
Expand Down

0 comments on commit c1ae9f0

Please sign in to comment.