Bug 1347217 - lessen debug spew in deployment-checker r=Felipe a=gchang
authorDavid Keeler <dkeeler@mozilla.com>
Tue, 14 Mar 2017 10:10:57 -0700
changeset 395244 daf87d4151aa7e2abf73e347a02ec54ecc2450d0
parent 395243 b6b6a603722a7a2104f7c27863928eff8f4a28e7
child 395245 dd7871655d0386efcecd0221222dd07d37cdaec2
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, gchang
bugs1347217
milestone54.0a2
Bug 1347217 - lessen debug spew in deployment-checker r=Felipe a=gchang MozReview-Commit-ID: JWdnTMr8IaO
browser/extensions/deployment-checker/bootstrap.js
--- a/browser/extensions/deployment-checker/bootstrap.js
+++ b/browser/extensions/deployment-checker/bootstrap.js
@@ -40,17 +40,17 @@ class CertificateVerificationResult {
   }
 
   verifyCertFinished(aPRErrorCode, aVerifiedChain, aEVStatus) {
     let result = { hostname: this.hostname };
     if (aPRErrorCode == 0) {
       result.chain = certListToJSArray(aVerifiedChain);
     } else {
       result.error = "certificate reverification";
-      console.log(`${this.hostname}: ${aPRErrorCode}`);
+      Services.console.logStringMessage(`${this.hostname}: ${aPRErrorCode}`);
     }
     this.resolve(result);
   }
 }
 
 function makeRequest(hostname) {
   return new Promise((resolve) => {
     let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
@@ -188,25 +188,26 @@ function makeRequests() {
   for (let hostname of Object.keys(sites)) {
     promises.push(makeRequest(hostname));
   }
   return Promise.all(promises);
 }
 
 function analyzeAndReport(results) {
   let payload = { version: "1.0", mismatches: [] };
+  Services.console.logStringMessage("deployment-checker results:");
   for (let result of results) {
     // Skip if the connection resulted in any kind of error.
     if ("error" in result) {
-      console.log(`${result.hostname}: ${result.error} - skipping`);
+      Services.console.logStringMessage(`${result.hostname}: ${result.error} - skipping`);
       continue;
     }
     // Skip imported roots.
     if (!result.chain[result.chain.length - 1].isBuiltInRoot) {
-      console.log(`${result.hostname}: imported root - skipping`);
+      Services.console.logStringMessage(`${result.hostname}: imported root - skipping`);
       continue;
     }
 
     let report = false;
     let expectedHashes = sites[result.hostname];
     // If we have chains of different length, obviously we'll have different
     // chains, so report this chain.
     if (expectedHashes.length != result.chain.length) {
@@ -221,22 +222,20 @@ function analyzeAndReport(results) {
           report = true;
           break;
         }
       }
     }
     if (report) {
       payload.mismatches.push({ hostname: result.hostname,
                                 chain: certArrayToBase64(result.chain) });
+    } else {
+      Services.console.logStringMessage(`${result.hostname} sends expected certificate chain`);
     }
   }
-  console.log("deployment-checker results:");
-  console.log(results);
-  console.log("deployment-checker payload:");
-  console.log(payload);
   return TelemetryController.submitExternalPing("deployment-checker", payload,
                                                 {});
 }
 
 // We only run once - when installed.
 function install() {
   // Only run if we have a good indication that we're not in a testing
   // environment (in which case attempting to connect to telemetry.mozilla.org