Skip to content

Commit

Permalink
Ignore non-existent fields
Browse files Browse the repository at this point in the history
  • Loading branch information
martinusso committed Oct 24, 2018
1 parent a1790f6 commit bdaf7e8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/RocketChatHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ public function __construct(array $webhooks, $level = Logger::DEBUG, bool $bubbl
*/
protected function write(array $record): void
{
$level = $record['level'] ?? $this->level;
$content = [
"text" => "",
"attachments" => [
[
"title" => $record['level_name'],
"title_link" => $record['link'],
"text" => $record['message'],
"image_url" => $record['image_url'],
"color" => $this->levelColors[$record['level']],
"title" => $record['level_name'] ?? '',
"title_link" => $record['link'] ?? '',
"text" => $record['message'] ?? '',
"image_url" => $record['image_url'] ?? '',
"color" => $this->levelColors[$level],
],
],
];
Expand Down

0 comments on commit bdaf7e8

Please sign in to comment.