Skip to content

Commit

Permalink
Merge pull request #22 from middlebury/filter-comparison-fix
Browse files Browse the repository at this point in the history
Fix level comparison when filtering records
  • Loading branch information
Chrico authored Jul 18, 2024
2 parents 6b42275 + ad3a66a commit ecc0e72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Handler/LogzIoHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ public function handleBatch(array $records): void
$records = array_filter(
$records,
static function (LogRecord $record) use ($level): bool {
return ($record->level >= $level);
if (method_exists($level, 'includes')) {
return $level->includes($record->level);
}
else {
return ($record->level >= $level);
}
}
);

Expand Down

0 comments on commit ecc0e72

Please sign in to comment.