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:
		
							parent
							
								
									4b559c6ec6
								
							
						
					
					
						commit
						a9dbfcd48b
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue