Fallback to \n if os.EOL is not defined

This commit is contained in:
Gareth Jones
2012-07-04 09:25:08 +10:00
parent b6ba3bce00
commit 7a02f39921
2 changed files with 5 additions and 3 deletions

View File

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