use os.EOL instead of \n

This commit is contained in:
Gareth Jones 2012-07-04 08:53:09 +10:00
parent 3cbae96a97
commit 638ce187bb
2 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,8 @@
var layouts = require('../layouts')
, path = require('path')
, fs = require('fs')
, streams = require('../streams');
, streams = require('../streams')
, os = require('os');
/**
* File Appender writing the logs to a text file. Supports rolling of logs by size.
@ -46,7 +47,7 @@ function fileAppender (file, layout, logSize, numBackups) {
});
return function(loggingEvent) {
logFile.write(layout(loggingEvent)+'\n', "utf8");
logFile.write(layout(loggingEvent)+os.EOL, "utf8");
};
}

View File

@ -1,4 +1,5 @@
var dateFormat = require('./date_format')
, os = require('os')
, util = require('util')
, replacementRegExp = /%[sdj]/g
, layoutMakers = {
@ -197,7 +198,7 @@ function patternLayout (pattern) {
replacement = formatLogData(loggingEvent.data);
break;
case "n":
replacement = "\n";
replacement = os.EOL;
break;
case "p":
replacement = loggingEvent.level.toString();