Skip to content

Commit 9acd3af

Browse files
authored
filter logs by level when query (#280)
1 parent fe31a32 commit 9acd3af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

daily-rotate-file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ DailyRotateFile.prototype.query = function (options, callback) {
306306
}
307307

308308
var time = new Date(log.timestamp);
309-
if ((options.from && time < options.from) || (options.until && time > options.until)) {
309+
if ((options.from && time < options.from) ||
310+
(options.until && time > options.until) ||
311+
(options.level && options.level !== log.level)) {
310312
return;
311313
}
312314

0 commit comments

Comments
 (0)