aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-21 15:41:22 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-21 15:41:22 +0200
commit8e63763a77a0dd81791cb2c68fdd905b3e518bba (patch)
tree4b8d41a98f9598f8e2328493b68b36dc959bbeba /lib
parenta0756d1dbd9e8bbb37293b8b756f6aee1e205d65 (diff)
downloadbugzilla-triage-8e63763a77a0dd81791cb2c68fdd905b3e518bba.tar.gz
Clean up logging
- remove unnecessary logging messages - instead of dumping whole log store to stderr, give just count of items
Diffstat (limited to 'lib')
-rw-r--r--lib/bzpage.js8
-rw-r--r--lib/logger.js10
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 5344fbb..4906d13 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -50,7 +50,7 @@ var BZPage = function BZPage(doc, config) {
if ("submitsLogging" in config.gJSONData.configData &&
config.gJSONData.configData.submitsLogging) {
this.log = config.logger;
- console.log("this.log = " + this.log.toSource());
+ console.log("length of this.log.store = " + this.log.getLength());
this.setUpLogging();
}
@@ -69,7 +69,6 @@ var BZPage = function BZPage(doc, config) {
var commentArea = this.doc.getElementById("comment_status_commit");
if (commentArea) {
var brElementPlacer = commentArea.getElementsByTagName("br");
- console.log("brElementPlacer.length = " + brElementPlacer.length);
brElementPlacer = brElementPlacer[0];
if (brElementPlacer) {
brElementPlacer.setAttribute("id","brElementPlacer_location");
@@ -316,7 +315,7 @@ BZPage.prototype.createNewButton = function createNewButton (location, after, pk
// protection against double-firings
if (this.doc.getElementById(newId)) {
- console.error("Element with id " + newId + "already exists!");
+ console.log("Element with id " + newId + "already exists!");
return ;
}
@@ -550,7 +549,7 @@ BZPage.prototype.getOptionValue = function getOptionValue (id) {
if (element) {
return element.value;
} else {
- console.log("Failed to find element with id = " + id);
+ console.error("Failed to find element with id = " + id);
return "#NA";
}
};
@@ -662,7 +661,6 @@ BZPage.prototype.setUpLogging = function setUpLogging () {
console.log("Submit callback!");
var resp = that.log.addLogRecord(that);
- console.log("resp = " + resp);
if (resp === null) {
console.log("Avoiding submitting!");
// FIXME doesn't work ... still submitting'
diff --git a/lib/logger.js b/lib/logger.js
index 594f5c2..88a3215 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -11,9 +11,7 @@ function Logger(store, abbsMap) {
this.EmptyLogsColor = new Color(0, 255, 0);
this.FullLogsColor = new Color(0, 40, 103);
- console.log("store = " + store.toSource());
this.store = store;
- console.log("abbsMap = " + abbsMap.toSource());
this.abbsMap = abbsMap;
};
@@ -55,6 +53,14 @@ Logger.prototype.addLogRecord = function(that) {
return comment;
};
+Logger.prototype.getLength = function () {
+ var counter = 0;
+ for (var key in this.store) {
+ counter += 1;
+ }
+ return counter;
+}
+
Logger.prototype.getBugzillaAbbr = function(url) {
// for https://bugzilla.redhat.com/show_bug.cgi?id=579123 get RH
// for https://bugzilla.mozilla.org/show_bug.cgi?id=579123 get MoFo