Skip to content

Commit a584db3

Browse files
authored
fix(transport): eol='' not work (#1878)
1 parent 2299d19 commit a584db3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/winston/transports/console.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = class Console extends TransportStream {
3030
this.name = options.name || 'console';
3131
this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
3232
this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
33-
this.eol = options.eol || os.EOL;
33+
this.eol = (typeof options.eol === 'string') ? options.eol : os.EOL;
3434

3535
this.setMaxListeners(30);
3636
}

lib/winston/transports/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module.exports = class File extends TransportStream {
7777
this.rotationFormat = options.rotationFormat || false;
7878
this.zippedArchive = options.zippedArchive || false;
7979
this.maxFiles = options.maxFiles || null;
80-
this.eol = options.eol || os.EOL;
80+
this.eol = (typeof options.eol === 'string') ? options.eol : os.EOL;
8181
this.tailable = options.tailable || false;
8282

8383
// Internal state variables representing the number of files this instance

lib/winston/transports/stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = class Stream extends TransportStream {
3535
this._stream = options.stream;
3636
this._stream.setMaxListeners(Infinity);
3737
this.isObjectMode = options.stream._writableState.objectMode;
38-
this.eol = options.eol || os.EOL;
38+
this.eol = (typeof options.eol === 'string') ? options.eol : os.EOL;
3939
}
4040

4141
/**

0 commit comments

Comments
 (0)