diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-05-05 12:27:10 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 14:52:35 +0200 |
commit | da49b6460ae02a1a1f0e86aef8f541798730a18f (patch) | |
tree | a2c02abdd37fdff33ae4a2b7a3e989f8312a6261 /lib | |
parent | c603f0a1a2985bf225786122beeaf248ca87cd99 (diff) | |
download | bugzilla-triage-da49b6460ae02a1a1f0e86aef8f541798730a18f.tar.gz |
Make my console.myDebug configurable via about:config preference.
That is the Boolean variable bugzilla-triage.setting.debug
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libbugzilla.js | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/libbugzilla.js b/lib/libbugzilla.js index 3763eff..990c759 100644 --- a/lib/libbugzilla.js +++ b/lib/libbugzilla.js @@ -329,13 +329,13 @@ exports.makeJSONRPCCall = function makeJSONRPCCall(url, method, params, callback "params": params }; - console.myDebug("makeJSONRPCCall: out = " + JSON.stringify(msg)); +// console.log("makeJSONRPCCall: out = " + JSON.stringify(msg)); Request({ url: url, onComplete: function(response) { if (response.status == 200) { - console.myDebug("makeJSONRPCCall: in = " + response.text); +// console.log("makeJSONRPCCall: in = " + response.text); callback(response.json.result); } }, @@ -345,15 +345,24 @@ exports.makeJSONRPCCall = function makeJSONRPCCall(url, method, params, callback }; exports.initialize = function initialize(config, callback) { - var prefName = BTSPrefNS+"JSONURL"; - var urlStr = ""; + var prefJSONURLName = BTSPrefNS+"JSONURL"; + var prefDebugName = BTSPrefNS+"debug"; + var urlStr = "", + debugOption = false; // should we spit out a lot of debugging output - if (preferences.isSet(prefName)) { - urlStr = preferences.get(prefName); + if (preferences.isSet(prefJSONURLName)) { + urlStr = preferences.get(prefJSONURLName); } else { urlStr = JSONURLDefault; - preferences.set(prefName, JSONURLDefault); + preferences.set(prefJSONURLName, JSONURLDefault); + } + + if (preferences.isSet(prefDebugName)) { + debugOption = preferences.get(prefDebugName); + } + else { + preferences.set(prefDebugName, debugOption); } // Randomize URL to avoid caching @@ -388,6 +397,7 @@ exports.initialize = function initialize(config, callback) { } config.configData = {}; + config.configData.debuggingVerbose = debugOption; config.configData.matches = config.gJSONData.configData.matches; config.configData.skipMatches = config.configData.matches.map(function(x) { return x.replace("show_bug.cgi.*","((process|post)_bug|attachment)\.cgi$"); |