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

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