Skip to content

Commit 950ab3f

Browse files
author
Jeff Mealo
committedMar 17, 2023
Fix npm#6270: Do not log warnings about log cleanup when logs_max=0
1 parent 2e3b11a commit 950ab3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎lib/utils/log-file.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ class LogFiles {
223223
}
224224
}
225225
} catch (e) {
226-
log.warn('logfile', 'error cleaning log files', e)
226+
// If the user has disabled writing to logs, they're not expecting warnings about log cleanup failures
227+
if (this.#logsMax > 0) {
228+
log.warn('logfile', 'error cleaning log files', e)
229+
}
227230
} finally {
228231
log.silly('logfile', 'done cleaning log files')
229232
}

0 commit comments

Comments
 (0)