aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logger.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/logger.js b/lib/logger.js
index 3a534d4..1aec908 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -5,8 +5,9 @@ var urlMod = require("url");
var urilMod = require("util");
var Color = require("color").Color;
var tabs = require("tabs");
+var apiUtils = require("api-utils");
-var Logger = exports.Logger = function Logger(store, abbsMap) {
+function Logger(store, abbsMap) {
this.EmptyLogsColor = new Color(0, 255, 0);
this.FullLogsColor = new Color(0, 40, 103);
@@ -14,6 +15,8 @@ var Logger = exports.Logger = function Logger(store, abbsMap) {
this.abbsMap = abbsMap;
};
+exports.Logger = apiUtils.publicConstructor(Logger);
+
Logger.prototype.addLogRecord = function(that) {
var rec = {};
rec.date = new Date();
@@ -30,14 +33,14 @@ Logger.prototype.addLogRecord = function(that) {
console.log("rec = " + rec.toSource());
var clearLogAElem = that.doc.getElementById("clearLogs");
- if (clearLogAElem.style.color != this.FullLogsColor) {
- clearLogAElem.style.color = this.FullLogsColor;
+ if (clearLogAElem.style.color != that.FullLogsColor) {
+ clearLogAElem.style.color = that.FullLogsColor;
clearLogAElem.style.fontWeight = "bolder";
}
- if (this.store[recKey]) {
- this.store[recKey].comment += "<br/>\n" + comment;
+ if (that.store[recKey]) {
+ that.store[recKey].comment += "<br/>\n" + comment;
} else {
- this.store[recKey] = rec;
+ that.store[recKey] = rec;
}
}
return comment;
@@ -112,4 +115,4 @@ Logger.prototype.createBlankPage = function (ttl, bodyBuildCB) {
Logger.prototype.generateTimeSheet = function(body) {
var doc = body.ownerDocument;
this.timeSheetRecordsPrinter(body, this.store);
-};
+}; \ No newline at end of file