diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-05-05 12:27:10 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-05-05 12:27:10 +0200 |
commit | 4b99c3d6a0efca79d94fc29398f0eab1fd75d492 (patch) | |
tree | 610d660aaac3f687ecc7cc8238d4d2a11f60c4a7 /lib | |
parent | 2a8cfd4c1b55125d3211694496cea35cc9603ff9 (diff) | |
download | bugzilla-triage-4b99c3d6a0efca79d94fc29398f0eab1fd75d492.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$"); |