Skip to content

Commit

Permalink
[breaking api] Use os.EOL for all file writing by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Apr 7, 2015
1 parent 0120984 commit 92729a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/winston/transports/daily-rotate-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ var events = require('events'),
util = require('util'),
common = require('../common'),
Transport = require('./transport').Transport,
Stream = require('stream').Stream;
Stream = require('stream').Stream,
os = require('os');

//
// ### function DailyRotateFile (options)
Expand Down Expand Up @@ -74,6 +75,7 @@ var DailyRotateFile = exports.DailyRotateFile = function (options) {
this.timestamp = options.timestamp != null ? options.timestamp : true;
this.datePattern = options.datePattern != null ? options.datePattern : '.yyyy-MM-dd';
this.depth = options.depth || null;
this.eol = options.eol || os.EOL;

if (this.json) {
this.stringify = options.stringify;
Expand Down Expand Up @@ -162,7 +164,7 @@ DailyRotateFile.prototype.log = function (level, msg, meta, callback) {
depth: this.depth,
formatter: this.formatter,
humanReadableUnhandledException: this.humanReadableUnhandledException
}) + '\n';
}) + this.eol;

this._size += output.length;

Expand Down
4 changes: 2 additions & 2 deletions lib/winston/transports/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var events = require('events'),
Transport = require('./transport').Transport,
isWritable = require('isstream').isWritable,
Stream = require('stream').Stream,
osEOL = require('os').EOL;
os = require('os');

//
// ### function File (options)
Expand Down Expand Up @@ -76,7 +76,7 @@ var File = exports.File = function (options) {
this.prettyPrint = options.prettyPrint || false;
this.label = options.label || null;
this.timestamp = options.timestamp != null ? options.timestamp : true;
this.eol = options.eol || osEOL;
this.eol = options.eol || os.EOL;
this.tailable = options.tailable || false;
this.depth = options.depth || null;
this.showLevel = options.showLevel === undefined ? true : options.showLevel;
Expand Down

0 comments on commit 92729a6

Please sign in to comment.