fixed missing space between log data elements

This commit is contained in:
Gareth Jones
2011-09-15 08:18:24 +10:00
parent 12e71bda4e
commit 9a34d9edfd
2 changed files with 7 additions and 4 deletions
+3
View File
@@ -44,6 +44,9 @@ function formatLogData(logData) {
} }
data.forEach(function (item) { data.forEach(function (item) {
if (output) {
output += ' ';
}
if (item && item.stack) { if (item && item.stack) {
output += item.stack; output += item.stack;
} else { } else {
+2 -2
View File
@@ -57,14 +57,14 @@ vows.describe('log4js layouts').addBatch({
}, },
'should support the console.log format for the message' : function(layout) { 'should support the console.log format for the message' : function(layout) {
assert.equal(layout({ assert.equal(layout({
data: ["thing %d", 1] data: ["thing %d", 1, "cheese"]
, startTime: new Date(2010, 11, 5, 14, 18, 30, 45) , startTime: new Date(2010, 11, 5, 14, 18, 30, 45)
, categoryName: "cheese" , categoryName: "cheese"
, level : { , level : {
colour: "green" colour: "green"
, toString: function() { return "ERROR"; } , toString: function() { return "ERROR"; }
} }
}), "thing 1"); }), "thing 1 'cheese'");
}, },
'should output the first item even if it is not a string': function(layout) { 'should output the first item even if it is not a string': function(layout) {
assert.equal(layout({ assert.equal(layout({