control client dump statements through pref
authorJason Etheridge <jason@esilibrary.com>
Fri, 7 Oct 2011 15:38:14 +0000 (11:38 -0400)
committerJason Etheridge <jason@esilibrary.com>
Fri, 7 Oct 2011 15:38:14 +0000 (11:38 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/skin/custom.js.example

index 5325fd7..b23a31f 100644 (file)
 */
 
 // Debugging aids.  _dump_level = 4 enables all dump statements
-_dump_level = 4;
+try {
+    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
+    if (prefs.prefHasUserValue('oils.dump_level')) {
+        _dump_level = prefs.getIntPref('oils.dump_level');
+    }
+} catch(E) {
+    dump('Error setting _dump_level in custom.js for ' + location.href + '\n');
+}
 
 var _dump_prefix = '0';
 try {