Skip to content

Commit c198523

Browse files
td-tomaszwbt
authored andcommittedMay 18, 2023
move guard higher and add comment
1 parent 2609a55 commit c198523

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎lib/winston/transports/file.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@ module.exports = class File extends TransportStream {
155155
debug('logged %s %s', this._size, output);
156156
this.emit('logged', info);
157157

158-
// Do not attempt to rotate files while opening
159-
if (this._opening) {
158+
// Do not attempt to rotate files while rotating
159+
if (this._rotate) {
160160
return;
161161
}
162-
if (this._rotate) {
162+
163+
// Do not attempt to rotate files while opening
164+
if (this._opening) {
163165
return;
164166
}
165167

0 commit comments

Comments
 (0)