Skip to content

Commit

Permalink
disable verbose logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
mnutt committed Apr 6, 2015
1 parent 25ebcc6 commit 99f1465
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/cropduster.js
Expand Up @@ -102,14 +102,14 @@ window.CD = {

CD._readyToCapture = false;
if (typeof(MICapture) == 'undefined') {
console.log("suspended, will end in " + maxSuspension + " millis");
CD.log("suspended, will end in " + maxSuspension + " millis");
} else {
MICapture.begin();
}

window.onerror = function(message, file, lineNumber) {
CD.capture();
console.log(message);
CD.log(message);
};
setTimeout(function() {
CD.capture();
Expand All @@ -119,7 +119,7 @@ window.CD = {
capture: function() {
CD._readyToCapture = true;
if(typeof(MICapture) == 'undefined') {
console.log("now ready to capture");
CD.log("now ready to capture");
} else {
MICapture.end();
}
Expand Down Expand Up @@ -148,7 +148,7 @@ window.CD = {
var req = new XMLHttpRequest();
req.onerror = function () {
CD.capture();
console.log("XHR error for " + url);
CD.log("XHR error for " + url);
};
req.onload = function() {
CD.capture();
Expand Down Expand Up @@ -214,7 +214,7 @@ window.CD = {
};
img.onerror = function() {
imagesLeft -= 1;
console.log("Error for " + url);
CD.log("Image load error for " + url);
finish();
};

Expand All @@ -236,5 +236,7 @@ window.CD = {
CD.capture();
}
}
}
},

log: console.log
};
3 changes: 3 additions & 0 deletions tests/tests.js
@@ -1,5 +1,8 @@
var container = $("<div style='position: absolute; left: -5000px;'></div>").appendTo('body');

// Disable debugging output
CD.log = function() {};

test("CD.$", function() {
equal(CD.$('body')[0], document.body, "finds elements" );
});
Expand Down

0 comments on commit 99f1465

Please sign in to comment.