Skip to content

Commit

Permalink
Merge pull request #1049 from spiral/feature/monolog-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 3, 2024
1 parent 6bdbea3 commit ab7a59c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Monolog/TelemetryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Spiral\Telemetry\Monolog;

use Monolog\LogRecord;
use Monolog\Processor\ProcessorInterface;
use Psr\Container\ContainerInterface;
use Spiral\Telemetry\TracerInterface;
Expand All @@ -15,8 +16,12 @@ public function __construct(
) {
}

public function __invoke(array $record): array
public function __invoke(LogRecord|array $record): array
{
if ($record instanceof LogRecord) {
$record = $record->toArray();
}

$tracer = $this->container->get(TracerInterface::class);
\assert($tracer instanceof TracerInterface);

Expand Down

0 comments on commit ab7a59c

Please sign in to comment.