mirror of
https://github.com/friendica/friendica
synced 2025-01-18 16:24:27 +00:00
Improve the log level display
This commit is contained in:
parent
9ae4a17977
commit
82327b0b06
4 changed files with 30 additions and 12 deletions
|
@ -66,11 +66,14 @@ class Settings extends BaseAdmin
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
$log_choices = [
|
$log_choices = [
|
||||||
LogLevel::ERROR => 'Error',
|
LogLevel::EMERGENCY => 'Emergency',
|
||||||
LogLevel::WARNING => 'Warning',
|
LogLevel::ALERT => 'Alert',
|
||||||
LogLevel::NOTICE => 'Notice',
|
LogLevel::CRITICAL => 'Critical',
|
||||||
LogLevel::INFO => 'Info',
|
LogLevel::ERROR => 'Error',
|
||||||
LogLevel::DEBUG => 'Debug',
|
LogLevel::WARNING => 'Warning',
|
||||||
|
LogLevel::NOTICE => 'Notice',
|
||||||
|
LogLevel::INFO => 'Info',
|
||||||
|
LogLevel::DEBUG => 'Debug',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (ini_get('log_errors')) {
|
if (ini_get('log_errors')) {
|
||||||
|
|
|
@ -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'] ?? '',
|
||||||
|
@ -71,10 +73,10 @@ class View extends BaseAdmin
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
$data = DI::parsedLogIterator()
|
$data = DI::parsedLogIterator()
|
||||||
->open($f)
|
->open($f)
|
||||||
->withLimit(self::LIMIT)
|
->withLimit(self::LIMIT)
|
||||||
->withFilters($filters)
|
->withFilters($filters)
|
||||||
->withSearch($search);
|
->withSearch($search);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.<br/>Check to see if file %1$s is readable.', $f);
|
$error = DI::l10n()->t('Couldn\'t open <strong>%1$s</strong> log file.<br/>Check to see if file %1$s is readable.', $f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue