autoconfig: add log_obj debug function

As the API isn't well documented, add this helper function to log object
properties.
This commit is contained in:
Oliver Smith 2023-04-06 16:54:07 +00:00
parent 4b559c6ec6
commit a9dbfcd48b
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -29,6 +29,21 @@ function log(line) {
logFileStream.write(line, line.length);
}
// Debug function for logging object attributes
function log_obj(obj) {
var prop;
var value;
for (var prop in obj) {
try {
value = obj[prop];
} catch(e) {
value = e;
}
log(" - " + prop + ": " + value);
}
}
function trigger_firefox_restart() {
log("Triggering Firefox restart");
var appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);