|
3 | 3 | {%import_selfashelper %} |
4 | 4 |
|
5 | 5 | {%blocktoolbar %} |
6 | | - {%ifcollector.counterrorsorcollector.countdeprecationsorcollector.countscreams %} |
| 6 | + {%ifcollector.counterrorsorcollector.countdeprecationsorcollector.countwarnings %} |
7 | 7 | {%seticon %} |
8 | | - {%setstatus_color=collector.counterrors?'red':collector.countdeprecations?'yellow':'' %} |
9 | | - {%seterror_count=collector.counterrors+collector.countdeprecations %} |
| 8 | + {%setstatus_color=collector.counterrors?'red':'yellow' %} |
10 | 9 | {{include('@WebProfiler/Icon/logger.svg') }} |
11 | | - <spanclass="sf-toolbar-value">{{error_count }}</span> |
| 10 | + <spanclass="sf-toolbar-value">{{collector.counterrors ?: (collector.countdeprecations+collector.countwarnings) }}</span> |
12 | 11 | {%endset %} |
13 | 12 |
|
14 | 13 | {%settext %} |
|
18 | 17 | </div> |
19 | 18 |
|
20 | 19 | <divclass="sf-toolbar-info-piece"> |
21 | | - <b>Deprecated Calls</b> |
22 | | - <spanclass="sf-toolbar-status sf-toolbar-status-{{collector.countdeprecations?'yellow' }}">{{collector.countdeprecations|default(0) }}</span> |
| 20 | + <b>Warnings</b> |
| 21 | + <spanclass="sf-toolbar-status sf-toolbar-status-{{collector.countwarnings?'yellow' }}">{{collector.countwarnings|default(0) }}</span> |
23 | 22 | </div> |
24 | 23 |
|
25 | 24 | <divclass="sf-toolbar-info-piece"> |
26 | | - <b>Silenced Errors</b> |
27 | | - <spanclass="sf-toolbar-status">{{collector.countscreams|default(0) }}</span> |
| 25 | + <b>Deprecations</b> |
| 26 | + <spanclass="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 | {%blockmenu %} |
36 | | - <spanclass="label label-status-{{collector.counterrors?'error':collector.countdeprecations?'warning' }} {{collector.logsisempty?'disabled' }}"> |
| 35 | + <spanclass="label label-status-{{collector.counterrors?'error':collector.countdeprecationsorcollector.countwarnings?'warning' }} {{collector.logsisempty?'disabled' }}"> |
37 | 36 | <spanclass="icon">{{include('@WebProfiler/Icon/logger.svg') }}</span> |
38 | 37 | <strong>Logs</strong> |
39 | | - {%ifcollector.counterrorsorcollector.countdeprecations %} |
| 38 | + {%ifcollector.counterrorsorcollector.countdeprecationsorcollector.countwarnings%} |
40 | 39 | <spanclass="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 | {%setdeprecation_logs,debug_logs,info_and_error_logs,silenced_logs= [], [], [], [] %} |
57 | 56 | {%forlogincollector.logs %} |
58 | | - {%iflog.context.errorCountisdefinedandlog.context.typeisdefinedandlog.context.typein ['E_DEPRECATED','E_USER_DEPRECATED'] %} |
| 57 | + {%iflog.screamisdefinedandnotlog.scream %} |
59 | 58 | {%setdeprecation_logs=deprecation_logs|merge([log]) %} |
60 | | - {%elseiflog.context.screamisdefinedandlog.context.scream==true %} |
| 59 | + {%elseiflog.screamisdefinedandlog.scream %} |
61 | 60 | {%setsilenced_logs=silenced_logs|merge([log]) %} |
62 | 61 | {%elseiflog.priorityName=='DEBUG' %} |
63 | 62 | {%setdebug_logs=debug_logs|merge([log]) %} |
|
68 | 67 |
|
69 | 68 | <divclass="sf-tabs"> |
70 | 69 | <divclass="tab"> |
71 | | - <h3class="tab-title">Info.& Errors <spanclass="badge">{{info_and_error_logs|length }}</span></h3> |
| 70 | + <h3class="tab-title">Info.& Errors <spanclass="badge status-{{collector.counterrors?'error':collector.countwarnings?'warning' }}">{{collector.counterrors ?:info_and_error_logs|length }}</span></h3> |
72 | 71 |
|
73 | 72 | <divclass="tab-content"> |
74 | 73 | {%ifinfo_and_error_logsisempty %} |
|
84 | 83 | <divclass="tab"> |
85 | 84 | {# 'deprecation_logs|length' is not used because deprecations are |
86 | 85 | now grouped and the group count doesn't match the message count#} |
87 | | - <h3class="tab-title">Deprecations <spanclass="badge">{{collector.countdeprecations|default(0) }}</span></h3> |
| 86 | + <h3class="tab-title">Deprecations <spanclass="badge status-{{collector.countdeprecations?'warning' }}">{{collector.countdeprecations|default(0) }}</span></h3> |
88 | 87 |
|
89 | 88 | <divclass="tab-content"> |
90 | 89 | {%ifdeprecation_logsisempty %} |
|
112 | 111 | </div> |
113 | 112 |
|
114 | 113 | <divclass="tab"> |
115 | | - <h3class="tab-title">SilencedErrors<spanclass="badge">{{collector.countscreams|default(0) }}</span></h3> |
| 114 | + <h3class="tab-title">SilencedPHP Notices<spanclass="badge">{{collector.countscreams|default(0) }}</span></h3> |
116 | 115 |
|
117 | 116 | <divclass="tab-content"> |
118 | 117 | {%ifsilenced_logsisempty %} |
|
138 | 137 | <tr> |
139 | 138 | <th>{{show_level?'Level':'Time' }}</th> |
140 | 139 | {%ifchannel_is_defined %}<th>Channel</th>{%endif %} |
141 | | - <th>Message</th> |
| 140 | + <thclass="full-width">Message</th> |
142 | 141 | </tr> |
143 | 142 | </thead> |
144 | 143 |
|
145 | 144 | <tbody> |
146 | 145 | {%forloginlogs %} |
147 | 146 | {%setcss_class=is_deprecation?'' |
148 | 147 | :log.priorityNamein ['CRITICAL','ERROR','ALERT','EMERGENCY']?'status-error' |
149 | | -:log.priorityNamein ['NOTICE','WARNING']?'status-warning' |
| 148 | +:log.priorityName=='WARNING'?'status-warning' |
150 | 149 | %} |
151 | 150 | <trclass="{{css_class }}"> |
152 | | - <tdclass="font-normal text-small"> |
| 151 | + <tdclass="font-normal text-small"nowrap> |
153 | 152 | {%ifshow_level %} |
154 | | - <spanclass="colored text-bold nowrap">{{log.priorityName }}</span> |
| 153 | + <spanclass="colored text-bold">{{log.priorityName }}</span> |
155 | 154 | {%endif %} |
156 | | - <spanclass="text-mutednowrapnewline">{{log.timestamp|date('H:i:s') }}</span> |
| 155 | + <spanclass="text-muted newline">{{log.timestamp|date('H:i:s') }}</span> |
157 | 156 | </td> |
158 | 157 |
|
159 | 158 | {%ifchannel_is_defined %} |
160 | | - <tdclass="font-normal text-small text-bold nowrap">{{log.channel }}</td> |
| 159 | + <tdclass="font-normal text-small text-bold"nowrap> |
| 160 | + {{log.channel }} |
| 161 | + {%iflog.errorCountisdefinedandlog.errorCount>1 %} |
| 162 | + <spanclass="text-muted">({{log.errorCount }} times)</span> |
| 163 | + {%endif %} |
| 164 | + </td> |
| 165 | + |
161 | 166 | {%endif %} |
162 | 167 |
|
163 | 168 | <tdclass="font-normal">{{ helper.render_log_message(category,loop.index,log,is_deprecation) }}</td> |
|
168 | 173 | {%endmacro %} |
169 | 174 |
|
170 | 175 | {%macro render_log_message(category,log_index,log,is_deprecation=false) %} |
171 | | - {{log.message }} |
172 | | - |
173 | | - {%iflog.context.errorCountisdefinedandlog.context.errorCount>1 %} |
174 | | - <spanclass="text-small text-bold">({{log.context.errorCount }} times)</span> |
175 | | - {%endif %} |
176 | | - |
177 | 176 | {%ifis_deprecation %} |
178 | | - {%settrace=log.context.trace|default([]) %} |
179 | | - {%settrace_id='sf-call-trace-'~category~'-'~log_index %} |
| 177 | + {{log.message }} |
180 | 178 |
|
| 179 | + {%setcontext_id='context-'~category~'-'~log_index %} |
181 | 180 |
|
182 | | - {%iftrace %} |
183 | | - <buttonclass="btn-link text-small sf-toggle"data-toggle-selector="#{{trace_id }}"data-toggle-alt-content="Hide stack trace">Show stack trace</button> |
184 | | - {%endif %} |
185 | | - |
186 | | - {%forindex,callintraceifindex>1 %} |
187 | | - {%ifindex==2 %} |
188 | | - <ulclass="sf-call-trace hidden"id="{{trace_id }}"> |
189 | | - {%endif %} |
| 181 | + <spanclass="metadata"> |
| 182 | + <aclass="btn btn-link text-small sf-toggle"data-toggle-selector="#{{context_id }}"data-toggle-alt-content="Hide trace">Show trace</a> |
190 | 183 |
|
191 | | - {%ifcall.classisdefined %} |
192 | | - {%setfrom=call.class|abbr_class~'::'~call.function|abbr_method() %} |
193 | | - {%elseifcall.functionisdefined %} |
194 | | - {%setfrom=call.function|abbr_method %} |
195 | | - {%elseifcall.fileisdefined %} |
196 | | - {%setfrom=call.file %} |
197 | | - {%else %} |
198 | | - {%setfrom='-' %} |
199 | | - {%endif %} |
200 | | - |
201 | | - {%setfile_name= (call.fileisdefinedandcall.lineisdefined)?call.file|replace({'\\':'/'})|split('/')|last %} |
202 | | - |
203 | | - <li> |
204 | | - {{from|raw }} |
205 | | - {%iffile_name %} |
206 | | - <spanclass="text-small">(called from {{call.file|format_file(call.line,file_name)|raw }})</span> |
207 | | - {%endif %} |
208 | | - </li> |
209 | | - |
210 | | - {%ifindex==trace|length-1 %} |
211 | | - </ul> |
212 | | - {%endif %} |
213 | | - {%endfor %} |
214 | | - {%else %} |
215 | | - {%iflog.contextisdefinedandlog.contextis notempty %} |
216 | | - {%setcontext_id='context-'~category~'-'~log_index %} |
217 | | - {%setcontext_dump= profiler_dump(log.context) %} |
218 | | - |
219 | | - <divclass="metadata"> |
220 | | - <strong>Context</strong>: |
| 184 | + <divid="{{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 | + {%elseiflog.contextisdefinedandlog.contextis notempty %} |
| 189 | + {{ profiler_dump_log(log.message,log.context) }} |
221 | 190 |
|
222 | | - {%ifcontext_dump|length>120 %} |
223 | | - {{context_dump[:120] }} ... |
| 191 | + {%setcontext_id='context-'~category~'-'~log_index %} |
224 | 192 |
|
225 | | - <aclass="btn-link text-small sf-toggle"data-toggle-selector="#{{context_id }}"data-toggle-alt-content="Hide full context">Show full context</a> |
| 193 | + <spanclass="metadata"> |
| 194 | + <aclass="btn btn-link text-small sf-toggle"data-toggle-selector="#{{context_id }}"data-toggle-alt-content="Hide context">Show context</a> |
226 | 195 |
|
227 | | - <divid="{{context_id }}"class="context"> |
228 | | - {{dump(log.context) }} |
229 | | - </div> |
230 | | - {%else %} |
231 | | - {{context_dump }} |
232 | | - {%endif %} |
| 196 | + <divid="{{context_id }}"class="context sf-toggle-content sf-toggle-hidden"> |
| 197 | + {{ profiler_dump(log.context, maxDepth=1) }} |
233 | 198 | </div> |
234 | | - {%endif %} |
| 199 | + </span> |
| 200 | + {%else %} |
| 201 | + {{log.message }} |
235 | 202 | {%endif %} |
236 | 203 | {%endmacro %} |