Improve the log level display

This commit is contained in:
Michael 2024-05-11 19:56:28 +00:00
parent 9ae4a17977
commit 82327b0b06
4 changed files with 30 additions and 12 deletions

View file

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

View file

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

View file

@ -773,3 +773,13 @@ figure.img-allocated-height img{
color: #731289; /* purple */ color: #731289; /* purple */
font-weight: bold; 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}}"> data-data="{{$row->data}}" data-source="{{$row->source}}">
<td>{{$row->date}}</td> <td>{{$row->date}}</td>
<td class=" <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 == "ERROR"}}bg-danger
{{elseif $row->level == "WARNING"}}bg-warning {{elseif $row->level == "WARNING"}}bg-warning
{{elseif $row->level == "NOTICE"}}bg-info {{elseif $row->level == "NOTICE"}}bg-info
{{elseif $row->level == "DEBUG"}}text-muted {{elseif $row->level == "INFO"}}bg-info
{{else}}text-muted
{{/if}} {{/if}}
">{{$row->level}}</td> ">{{$row->level}}</td>
<td>{{$row->context}}</td> <td>{{$row->context}}</td>