|
3 | 3 | {% import _self as helper %}
|
4 | 4 |
|
5 | 5 | {% block toolbar %}
|
6 |
| - {% if collector.counterrors or collector.countdeprecations or collector.countscreams %} |
| 6 | + {% if collector.counterrors or collector.countdeprecations or collector.countwarnings %} |
7 | 7 | {% set icon %}
|
8 |
| - {% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %} |
9 |
| - {% set error_count = collector.counterrors + collector.countdeprecations %} |
| 8 | + {% set status_color = collector.counterrors ? 'red' : 'yellow' %} |
10 | 9 | {{ include('@WebProfiler/Icon/logger.svg') }}
|
11 |
| - <span class="sf-toolbar-value">{{ error_count }}</span> |
| 10 | + <span class="sf-toolbar-value">{{ collector.counterrors + collector.countdeprecations + collector.countwarnings }}</span> |
12 | 11 | {% endset %}
|
13 | 12 |
|
14 | 13 | {% set text %}
|
|
18 | 17 | </div>
|
19 | 18 |
|
20 | 19 | <div class="sf-toolbar-info-piece">
|
21 |
| - <b>Deprecated Calls</b> |
22 |
| - <span class="sf-toolbar-status sf-toolbar-status-{{ collector.countdeprecations ? 'yellow' }}">{{ collector.countdeprecations|default(0) }}</span> |
| 20 | + <b>Warnings</b> |
| 21 | + <span class="sf-toolbar-status sf-toolbar-status-{{ collector.countwarnings ? 'yellow' }}">{{ collector.countwarnings|default(0) }}</span> |
23 | 22 | </div>
|
24 | 23 |
|
25 | 24 | <div class="sf-toolbar-info-piece">
|
26 |
| - <b>Silenced Errors</b> |
27 |
| - <span class="sf-toolbar-status">{{ collector.countscreams|default(0) }}</span> |
| 25 | + <b>Deprecated Calls</b> |
| 26 | + <span class="sf-toolbar-status sf-toolbar-status-{{ collector.countdeprecations ? 'yellow' }}">{{ collector.countdeprecations|default(0) }}</span> |
28 | 27 | </div>
|
29 | 28 | {% endset %}
|
30 | 29 |
|
|
33 | 32 | {% endblock %}
|
34 | 33 |
|
35 | 34 | {% block menu %}
|
36 |
| - <span class="label label-status-{{ collector.counterrors ? 'error' : collector.countdeprecations ? 'warning' }} {{ collector.logs is empty ? 'disabled' }}"> |
| 35 | + <span class="label label-status-{{ collector.counterrors ? 'error' : collector.countdeprecations or collector.countwarnings ? 'warning' }} {{ collector.logs is empty ? 'disabled' }}"> |
37 | 36 | <span class="icon">{{ include('@WebProfiler/Icon/logger.svg') }}</span>
|
38 | 37 | <strong>Logs</strong>
|
39 |
| - {% if collector.counterrors or collector.countdeprecations %} |
| 38 | + {% if collector.counterrors or collector.countdeprecations or collector.countwarnings %} |
40 | 39 | <span class="count">
|
41 |
| - <span>{{ collector.counterrors ?: collector.countdeprecations }}</span> |
| 40 | + <span>{{ collector.counterrors + collector.countdeprecations + collector.countwarnings }}</span> |
42 | 41 | </span>
|
43 | 42 | {% endif %}
|
44 | 43 | </span>
|
|
55 | 54 | {# sort collected logs in groups #}
|
56 | 55 | {% set deprecation_logs, debug_logs, info_and_error_logs, silenced_logs = [], [], [], [] %}
|
57 | 56 | {% for log in collector.logs %}
|
58 |
| - {% if log.context.errorCount is defined and log.context.type is defined and log.context.type in ['E_DEPRECATED', 'E_USER_DEPRECATED'] %} |
| 57 | + {% if log.scream is defined and not log.scream %} |
59 | 58 | {% set deprecation_logs = deprecation_logs|merge([log]) %}
|
60 |
| - {% elseif log.context.scream is defined and log.context.scream == true %} |
| 59 | + {% elseif log.scream is defined and log.scream %} |
61 | 60 | {% set silenced_logs = silenced_logs|merge([log]) %}
|
62 | 61 | {% elseif log.priorityName == 'DEBUG' %}
|
63 | 62 | {% set debug_logs = debug_logs|merge([log]) %}
|
|
138 | 137 | <tr>
|
139 | 138 | <th>{{ show_level ? 'Level' : 'Time' }}</th>
|
140 | 139 | {% if channel_is_defined %}<th>Channel</th>{% endif %}
|
141 |
| - <th>Message</th> |
| 140 | + <th class="full-width">Message</th> |
142 | 141 | </tr>
|
143 | 142 | </thead>
|
144 | 143 |
|
145 | 144 | <tbody>
|
146 | 145 | {% for log in logs %}
|
147 | 146 | {% set css_class = is_deprecation ? ''
|
148 | 147 | : log.priorityName in ['CRITICAL', 'ERROR', 'ALERT', 'EMERGENCY'] ? 'status-error'
|
149 |
| - : log.priorityName in ['NOTICE', 'WARNING'] ? 'status-warning' |
| 148 | + : log.priorityName == 'WARNING' ? 'status-warning' |
150 | 149 | %}
|
151 | 150 | <tr class="{{ css_class }}">
|
152 |
| - <td class="font-normal text-small"> |
| 151 | + <td class="font-normal text-small" nowrap> |
153 | 152 | {% if show_level %}
|
154 |
| - <span class="colored text-bold nowrap">{{ log.priorityName }}</span> |
| 153 | + <span class="colored text-bold">{{ log.priorityName }}</span> |
155 | 154 | {% endif %}
|
156 |
| - <span class="text-muted nowrap newline">{{ log.timestamp|date('H:i:s') }}</span> |
| 155 | + <span class="text-muted newline">{{ log.timestamp|date('H:i:s') }}</span> |
157 | 156 | </td>
|
158 | 157 |
|
159 | 158 | {% if channel_is_defined %}
|
160 |
| - <td class="font-normal text-small text-bold nowrap">{{ log.channel }}</td> |
| 159 | + <td class="font-normal text-small text-bold" nowrap> |
| 160 | + {{ log.channel }} |
| 161 | + {% if log.errorCount is defined and log.errorCount > 1 %} |
| 162 | + <span class="text-muted">({{ log.errorCount }} times)</span> |
| 163 | + {% endif %} |
| 164 | + </td> |
| 165 | + |
161 | 166 | {% endif %}
|
162 | 167 |
|
163 | 168 | <td class="font-normal">{{ helper.render_log_message(category, loop.index, log, is_deprecation) }}</td>
|
|
170 | 175 | {% macro render_log_message(category, log_index, log, is_deprecation = false) %}
|
171 | 176 | {{ log.message }}
|
172 | 177 |
|
173 |
| - {% if log.context.errorCount is defined and log.context.errorCount > 1 %} |
174 |
| - <span class="text-small text-bold">({{ log.context.errorCount }} times)</span> |
175 |
| - {% endif %} |
176 |
| - |
177 | 178 | {% if is_deprecation %}
|
178 |
| - {% set trace = log.context.trace|default([]) %} |
179 |
| - {% set trace_id = 'sf-call-trace-' ~ category ~ '-' ~ log_index %} |
180 |
| - |
181 |
| - |
182 |
| - {% if trace %} |
183 |
| - <button class="btn-link text-small sf-toggle" data-toggle-selector="#{{ trace_id }}" data-toggle-alt-content="Hide stack trace">Show stack trace</button> |
184 |
| - {% endif %} |
| 179 | + {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} |
185 | 180 |
|
186 |
| - {% for index, call in trace if index > 1 %} |
187 |
| - {% if index == 2 %} |
188 |
| - <ul class="sf-call-trace hidden" id="{{ trace_id }}"> |
189 |
| - {% endif %} |
| 181 | + <span class="metadata"> |
| 182 | + <a class="btn btn-link text-small sf-toggle" data-toggle-selector="#{{ context_id }}" data-toggle-alt-content="Hide trace">Show trace</a> |
190 | 183 |
|
191 |
| - {% if call.class is defined %} |
192 |
| - {% set from = call.class|abbr_class ~ '::' ~ call.function|abbr_method() %} |
193 |
| - {% elseif call.function is defined %} |
194 |
| - {% set from = call.function|abbr_method %} |
195 |
| - {% elseif call.file is defined %} |
196 |
| - {% set from = call.file %} |
197 |
| - {% else %} |
198 |
| - {% set from = '-' %} |
199 |
| - {% endif %} |
200 |
| - |
201 |
| - {% set file_name = (call.file is defined and call.line is defined) ? call.file|replace({'\\': '/'})|split('/')|last %} |
202 |
| - |
203 |
| - <li> |
204 |
| - {{ from|raw }} |
205 |
| - {% if file_name %} |
206 |
| - <span class="text-small">(called from {{ call.file|format_file(call.line, file_name)|raw }})</span> |
207 |
| - {% endif %} |
208 |
| - </li> |
209 |
| - |
210 |
| - {% if index == trace|length - 1 %} |
211 |
| - </ul> |
212 |
| - {% endif %} |
213 |
| - {% endfor %} |
214 |
| - {% else %} |
215 |
| - {% if log.context is defined and log.context is not empty %} |
216 |
| - {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} |
217 |
| - {% set context_dump = profiler_dump(log.context) %} |
218 |
| - |
219 |
| - <div class="metadata"> |
220 |
| - <strong>Context</strong>: |
221 |
| - |
222 |
| - {% if context_dump|length > 120 %} |
223 |
| - {{ context_dump[:120] }} ... |
| 184 | + <div id="{{ context_id }}" class="context sf-toggle-content sf-toggle-hidden"> |
| 185 | + {{ profiler_dump(log.context.seek('exception').seek('\0Exception\0trace'), maxDepth=2) }} |
| 186 | + </div> |
| 187 | + </span> |
| 188 | + {% elseif log.context is defined and log.context is not empty %} |
| 189 | + {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} |
224 | 190 |
|
225 |
| - <a class="btn-link text-small sf-toggle" data-toggle-selector="#{{ context_id }}" data-toggle-alt-content="Hide full context">Show full context</a> |
| 191 | + <span class="metadata"> |
| 192 | + <a class="btn btn-link text-small sf-toggle" data-toggle-selector="#{{ context_id }}" data-toggle-alt-content="Hide context">Show context</a> |
226 | 193 |
|
227 |
| - <div id="{{ context_id }}" class="context"> |
228 |
| - {{ dump(log.context) }} |
229 |
| - </div> |
230 |
| - {% else %} |
231 |
| - {{ context_dump }} |
232 |
| - {% endif %} |
| 194 | + <div id="{{ context_id }}" class="context sf-toggle-content sf-toggle-hidden"> |
| 195 | + {{ profiler_dump(log.context, maxDepth=1) }} |
233 | 196 | </div>
|
234 |
| - {% endif %} |
| 197 | + </span> |
235 | 198 | {% endif %}
|
236 | 199 | {% endmacro %}
|
0 commit comments