aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logger.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-05-31 19:17:19 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-05-31 19:17:19 +0200
commit475c2df048fa5c42ba913ceeba3e6201938031f7 (patch)
tree5a77c7f6c5bff188ce96020d6186fcb2f07696e5 /lib/logger.js
parent2447e31a804eb7d7fe5ef01b974cba3b615e0594 (diff)
downloadbugzilla-triage-475c2df048fa5c42ba913ceeba3e6201938031f7.tar.gz
rewrite util.js to be more compliant with SDK usage.
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/logger.js b/lib/logger.js
index ba9afc8..6bd8142 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -1,8 +1,10 @@
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
"use strict";
+var urlMod = require("url");
+var urilMod = require("util");
-exports.Logger = function Logger(store, abbsMap) {
+var Logger = exports.Logger = function Logger(store, abbsMap) {
this.EmptyLogsColor = new Color(0, 255, 0);
this.FullLogsColor = new Color(0, 40, 103);
@@ -20,7 +22,8 @@ Logger.prototype.addLogRecord = function(that) {
if (comment && comment.length > 0) {
comment = comment.trim();
rec.comment = comment;
- let recKey = hlpr.getISODate(rec.date) + "+" + hlpr.getHost(rec.url)
+ let recKey = utilMod.getISODate(rec.date) + "+"
+ + urlMod.parse(rec.url).host
+ "+" + that.bugNo;
let clearLogAElem = that.doc.getElementById("clearLogs");
clearLogAElem.style.color = this.FullLogsColor;
@@ -40,7 +43,7 @@ Logger.prototype.addLogRecord = function(that) {
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
- var abbr = this.abbsMap[hlpr.getHost(url)];
+ var abbr = this.abbsMap[urlMod.parse(url).host];
return abbr;
}
@@ -63,10 +66,10 @@ Logger.prototype.timeSheetRecordsPrinter = function(body, records) {
// now print the array
tmpArr.forEach(function(rec) {
let x = rec[1];
- let dayStr = hlpr.getISODate(x.date);
- let host = hlpr.getHost(x.url);
+ let dayStr = utilMod.getISODate(x.date);
+ let host = urlMod.parse(x.url).host;
let BZName = that.getBugzillaAbbr(x.url);
- let bugNo = hlpr.getBugNo(x.url);
+ let bugNo = utilMod.getBugNo(x.url);
if (dayStr != currentDay) {
currentDay = dayStr;
body.innerHTML += "<hr/><p><strong>" + currentDay