Skip to content

Commit 28af76c

Browse files
committed
ICL: Different colors support for deduplicated notifications.
1 parent 38acb49 commit 28af76c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Log/HtmlFormatter.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function format(array $record)
2929
protected function composeStyle(array $record)
3030
{
3131
$level = $record['level'];
32+
$level_name = $record['level_name'];
3233

3334
return "<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
3435
<style>
@@ -37,11 +38,13 @@ protected function composeStyle(array $record)
3738
font-size: 16px;
3839
}
3940
.title, .subtitle {
40-
background: {$this->logLevels[$level]};
4141
color: #ffffff;
4242
margin: 0px;
4343
padding: 15px;
4444
}
45+
.title.{$level_name}, .subtitle.{$level_name} {
46+
background: {$this->logLevels[$level]};
47+
}
4548
.details-row {
4649
text-align: left;
4750
font-size: 16px;
@@ -63,7 +66,7 @@ protected function composeStyle(array $record)
6366
protected function composeTitle(array $record)
6467
{
6568
$levelName = e($record['level_name']);
66-
$title = "<h2 class='title'>{$levelName}</h2>";
69+
$title = "<h2 class='title {$levelName}'>{$levelName}</h2>";
6770

6871
$environment = app()->environment();
6972
if ($environment == 'production') {
@@ -72,7 +75,7 @@ protected function composeTitle(array $record)
7275

7376
$environment = e(str_upper($environment));
7477
$title .= '<style>.title { padding-bottom: 0px !important; } .subtitle { padding-top: 0px !important; }</style>';
75-
$title .= "<h3 class='subtitle'>This notification was sent from `{$environment}` environment!</h3>";
78+
$title .= "<h3 class='subtitle {$levelName}'>This notification was sent from `{$environment}` environment!</h3>";
7679

7780
return $title;
7881
}

0 commit comments

Comments
 (0)