Merge pull request #14146 from annando/loglevels

Improve the log level display
This commit is contained in:
Hypolite Petovan 2024-05-13 14:14:10 -04:00 committed by GitHub
commit 104d355096
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 12 deletions

View file

@ -66,6 +66,9 @@ class Settings extends BaseAdmin
parent::content();
$log_choices = [
LogLevel::EMERGENCY => 'Emergency',
LogLevel::ALERT => 'Alert',
LogLevel::CRITICAL => 'Critical',
LogLevel::ERROR => 'Error',
LogLevel::WARNING => 'Warning',
LogLevel::NOTICE => 'Notice',

View file

@ -47,6 +47,8 @@ class View extends BaseAdmin
$filters_valid_values = [
'level' => [
'',
LogLevel::EMERGENCY,
LogLevel::ALERT,
LogLevel::CRITICAL,
LogLevel::ERROR,
LogLevel::WARNING,
@ -54,7 +56,7 @@ class View extends BaseAdmin
LogLevel::INFO,
LogLevel::DEBUG,
],
'context' => ['', 'index', 'worker'],
'context' => ['', 'index', 'worker', 'daemon'],
];
$filters = [
'level' => $_GET['level'] ?? '',

View file

@ -773,3 +773,13 @@ figure.img-allocated-height img{
color: #731289; /* purple */
font-weight: bold;
}
.loglevel-alert {
color: #ff0000; /* red */
font-weight: bold;
font-style: italic;
}
.loglevel-emergency {
color: #731289; /* purple */
font-weight: bold;
font-style: italic;
}

View file

@ -65,11 +65,14 @@
data-data="{{$row->data}}" data-source="{{$row->source}}">
<td>{{$row->date}}</td>
<td class="
{{if $row->level == "CRITICAL"}}bg-danger
{{if $row->level == "EMERGENCY"}}bg-danger
{{elseif $row->level == "ALERT"}}bg-danger
{{elseif $row->level == "CRITICAL"}}bg-danger
{{elseif $row->level == "ERROR"}}bg-danger
{{elseif $row->level == "WARNING"}}bg-warning
{{elseif $row->level == "NOTICE"}}bg-info
{{elseif $row->level == "DEBUG"}}text-muted
{{elseif $row->level == "INFO"}}bg-info
{{else}}text-muted
{{/if}}
">{{$row->level}}</td>
<td>{{$row->context}}</td>