Skip to content

Commit

Permalink
Fix for missing type
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Dec 4, 2023
1 parent 09a6e7f commit 6743ac2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Log/NutgramFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ class NutgramFormatter implements FormatterInterface
{
public function format(LogRecord $record): void
{
$record->context['type'] === 'request' ? $this->formatRequest($record) : $this->formatResponse($record);
$type = $record->context['type'] ?? null;

if ($type === 'request') {
$this->formatRequest($record);
} elseif ($type === 'response') {
$this->formatResponse($record);
}
}

public function formatBatch(array $records): void
Expand Down

0 comments on commit 6743ac2

Please sign in to comment.