}
}
- this._stream = fs.createWriteStream(this.file);
+ this._stream = fs.createWriteStream(this.file, {flags: 'a'});
},
log : function () {
// We're not formatting objects for now.
if (!arguments[i].__skipConsole && !arguments[i].message.__skipConsole) {
- if (typeof arguments[i].message === 'object') {
- message.push(arguments[i].message);
- } else {
- message.push(this.format(arguments[i]));
- }
+ message.push(this.format(arguments[i]));
if (!severity) {
severity = arguments[i]._level
}
format : function (logObject) {
if (this.formatter) {
+ if (typeof logObject.message === 'object') {
+ return logObject.message;
+ }
return this.formatter.format(logObject, this.formatterOpts);
}
- return logObject.message;
+ return Cobalt.stringify(logObject);
}
}
});