aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libbugzilla.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libbugzilla.js')
-rw-r--r--lib/libbugzilla.js24
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$");