aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logger.js
diff options
context:
space:
mode:
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