[WebProfilerBundle] Improved page for logs
This commit is contained in:
parent
4b71fe0310
commit
5fdc650dfe
@ -35,6 +35,7 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface
|
||||
'priority' => $record['level'],
|
||||
'priorityName' => $record['level_name'],
|
||||
'context' => $record['context'],
|
||||
'channel' => isset($record['channel']) ? $record['channel'] : '',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -87,20 +87,30 @@
|
||||
</table>
|
||||
|
||||
{% if collector.logs %}
|
||||
<ul class="alt">
|
||||
<table>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Priority</th>
|
||||
<th>Channel</th>
|
||||
<th>Message and context</th>
|
||||
</tr>
|
||||
|
||||
{% set log_loop_index = 0 %}
|
||||
{% for log in collector.logs %}
|
||||
{% set is_deprecation = log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %}
|
||||
{% if priority == '-100' ? is_deprecation : log.priority >= priority %}
|
||||
{% set log_loop_index = log_loop_index + 1 %}
|
||||
<li class="{{ cycle(['odd', 'even'], log_loop_index) }}{% if log.context.scream is defined %} scream{% elseif log.priority >= 400 %} error{% elseif log.priority >= 300 or is_deprecation %} warning{% endif %}">
|
||||
{{ logger.display_message(loop.index, log, is_deprecation) }}
|
||||
</li>
|
||||
<tr class="{{ cycle(['odd', 'even'], log_loop_index) }}{% if log.context.scream is defined %} scream{% elseif log.priority >= 400 %} error{% elseif log.priority >= 300 or is_deprecation %} warning{% endif %}">
|
||||
<td>{{ log_loop_index }}</td>
|
||||
<td>{{ is_deprecation ? 'DEPRECATION' : log.priorityName }}</td>
|
||||
<td>{{ log.channel is defined ? log.channel }}</td>
|
||||
<td>{{ logger.display_message(loop.index, log, is_deprecation) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<li><em>No logs available for this priority.</em></li>
|
||||
<tr><td colspan="4"><em>No logs available for {{ priority }} priority.</em></td></tr>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>
|
||||
<em>No logs available.</em>
|
||||
@ -114,7 +124,7 @@
|
||||
{% set stack = log.context.stack|default([]) %}
|
||||
{% set id = 'sf-call-stack-' ~ log_index %}
|
||||
|
||||
DEPRECATED - {{ log.message }}
|
||||
{{ log.message }}
|
||||
|
||||
{% if stack %}
|
||||
<a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;">
|
||||
@ -144,7 +154,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{{ log.priorityName }} - {{ log.message }}
|
||||
{{ log.message }}
|
||||
{% if log.context is defined and log.context is not empty %}
|
||||
<br />
|
||||
<small>
|
||||
|
@ -179,7 +179,7 @@ pre, code {
|
||||
width: 250px;
|
||||
margin-left: -100%;
|
||||
}
|
||||
#collector-content table td {
|
||||
table td {
|
||||
background-color: white;
|
||||
}
|
||||
h1 {
|
||||
@ -273,15 +273,15 @@ ul.alt li {
|
||||
ul.alt li.even {
|
||||
background: #f1f7e2;
|
||||
}
|
||||
ul.alt li.error {
|
||||
ul.alt li.error, tr.error td {
|
||||
background-color: #f66;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
ul.alt li.warning {
|
||||
ul.alt li.warning, tr.warning td {
|
||||
background-color: #ffcc00;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
ul.alt li.scream, ul.alt li.scream strong {
|
||||
ul.alt li.scream, ul.alt li.scream strong, tr.scream td, tr.scream strong {
|
||||
color: gray;
|
||||
}
|
||||
ul.sf-call-stack li {
|
||||
|
Reference in New Issue
Block a user