8000 merged branch jalliot/profiler-logs (PR #4902) · nathanlon/symfony@5fb7214 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5fb7214

Browse files
committed
merged branch jalliot/profiler-logs (PR symfony#4902)
Commits ------- 77b4349 [WebProfiler] Improved logger panel Discussion ---------- [WebProfiler] Improved logger panel Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes * Add missing priority levels from filter * Display priority level in front of each log entry * Add a yellow background for warnings and use the red one for errors and above (previously only errors) * Display `No logs available for this priority.` when filter is too restrictive
2 parents 17888d2 + 77b4349 commit 5fb7214

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/public/css/profiler.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ ul.alt li.error {
309309
margin-bottom: 1px;
310310
}
311311

312+
ul.alt li.warning {
313+
background-color: #ffcc00;
314+
margin-bottom: 1px;
315+
}
316+
312317
td.main, td.menu {
313318
text-align: left;
314319
margin: 0;

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<input type="hidden" name="panel" value="logger" />
4242
<label for="priority">Priority</label>
4343
<select id="priority" name="priority" onchange="document.getElementById('priority-form').submit(); ">
44-
{% for value, text in { 100: 'DEBUG', 200: 'INFO', 300: 'WARNING', 400: 'ERROR', 500: 'CRITICAL', 550: 'ALERT' } %}
44+
{% for value, text in { 100: 'DEBUG', 200: 'INFO', 250: 'NOTICE', 300: 'WARNING', 400: 'ERROR', 500: 'CRITICAL', 550: 'ALERT', 600: 'EMERGENCY' } %}
4545
<option value="{{ value }}"{{ value == priority ? ' selected' : '' }}>{{ text }}</option>
4646
{% endfor %}
4747
</select>
@@ -56,15 +56,17 @@
5656
{% if collector.logs %}
5757
<ul class="alt">
5858
{% for log in collector.logs if log.priority >= priority %}
59-
<li class="{{ cy 9256 cle(['odd', 'even'], loop.index) }}{% if 'ERR' == log.priorityName or 'ERROR' == log.priorityName %} error{% endif %}">
60-
{{ log.message }}
59+
<li class="{{ cycle(['odd', 'even'], loop.index) }}{% if log.priority >= 400 %} error{% elseif log.priority >= 300 %} warning{% endif %}">
60+
{{ log.priorityName }} - {{ log.message }}
6161
{% if log.context is defined and log.context is not empty %}
6262
<br />
6363
<small>
6464
<strong>Context</strong>: {{ log.context|yaml_encode }}
6565
</small>
6666
{% endif %}
6767
</li>
68+
{% else %}
69+
<li><em>No logs available for this priority.</em></li>
6870
{% endfor %}
6971
</ul>
7072
{% else %}

0 commit comments

Comments
 (0)
0