Skip to content

Commit

Permalink
Allow level filtering to work with Monolog < 3.7.0 and Monolog > 3.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfranco committed Jul 11, 2024
1 parent 677b61b commit ad3a66a
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 $level->includes($record->level);
if (method_exists($level, 'includes')) {
return $level->includes($record->level);
}
else {
return ($record->level >= $level);
}
}
);

Expand Down

0 comments on commit ad3a66a

Please sign in to comment.