Bug 1449226 - Add better debug information for GPO. r=Felipe, a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Tue, 03 Apr 2018 17:24:08 -0500
changeset 463101 8495b5dc53c76f5190046e337e0b19a25810de74
parent 463100 dc9b50d160e1d7a715055d29fad9c309d41e18e8
child 463102 1a77d1f0ddc242652d9862e55d7133a0f300270a
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe, RyanVM
bugs1449226
milestone60.0
Bug 1449226 - Add better debug information for GPO. r=Felipe, a=RyanVM MozReview-Commit-ID: GCw0kARRuJ5
browser/components/enterprisepolicies/WindowsGPOParser.jsm
--- a/browser/components/enterprisepolicies/WindowsGPOParser.jsm
+++ b/browser/components/enterprisepolicies/WindowsGPOParser.jsm
@@ -29,16 +29,21 @@ var WindowsGPOParser = {
     }
     try {
       policies = registryToObject(childWrk, policies);
     } catch (e) {
       log.error(e);
     } finally {
       childWrk.close();
     }
+    // Need an extra check here so we don't
+    // JSON.stringify if we aren't in debug mode
+    if (log._maxLogLevel == "debug") {
+      log.debug(JSON.stringify(policies, null, 2));
+    }
     return policies;
   }
 };
 
 function registryToObject(wrk, policies) {
   if (!policies) {
     policies = {};
   }