Bug 480528 - Color Weave logs to help find errors, engine problems, etc.

This commit is contained in:
Edward Lee 2009-02-28 11:11:36 -08:00
parent 4aef6ff6d2
commit f4237bde35

View File

@ -362,8 +362,13 @@ BasicFormatter.prototype = {
format: function BF_format(message) {
let date = new Date(message.time);
// Pad a string to a certain length (20) with a character (space)
let pad = function BF__pad(str, len, chr) str +
new Array(Math.max((len || 20) - str.length + 1, 0)).join(chr || " ");
return date.toLocaleFormat(this.dateFormat) + "\t" +
message.loggerName + "\t" + message.levelDesc + "\t" +
pad(message.loggerName) + " " + message.levelDesc + "\t" +
message.message + "\n";
}
};