|
76 | 76 | <p>There are no log messages of this level.</p>
|
77 | 77 | </div>
|
78 | 78 | {% else %}
|
79 |
| - {{ helper.render_table(info_and_error_logs, true) }} |
| 79 | + {{ helper.render_table(info_and_error_logs, 'info', true) }} |
80 | 80 | {% endif %}
|
81 | 81 | </div>
|
82 | 82 | </div>
|
|
92 | 92 | <p>There are no log messages about deprecated features.</p>
|
93 | 93 | </div>
|
94 | 94 | {% else %}
|
95 |
| - {{ helper.render_table(deprecation_logs, false, true) }} |
| 95 | + {{ helper.render_table(deprecation_logs, 'deprecation', false, true) }} |
96 | 96 | {% endif %}
|
97 | 97 | </div>
|
98 | 98 | </div>
|
|
106 | 106 | <p>There are no log messages of this level.</p>
|
107 | 107 | </div>
|
108 | 108 | {% else %}
|
109 |
| - {{ helper.render_table(debug_logs) }} |
| 109 | + {{ helper.render_table(debug_logs, 'debug') }} |
110 | 110 | {% endif %}
|
111 | 111 | </div>
|
112 | 112 | </div>
|
|
120 | 120 | <p>There are no log messages of this level.</p>
|
121 | 121 | </div>
|
122 | 122 | {% else %}
|
123 |
| - {{ helper.render_table(silenced_logs) }} |
| 123 | + {{ helper.render_table(silenced_logs, 'silenced') }} |
124 | 124 | {% endif %}
|
125 | 125 | </div>
|
126 | 126 | </div>
|
|
129 | 129 | {% endif %}
|
130 | 130 | {% endblock %}
|
131 | 131 |
|
132 |
| -{% macro render_table(logs, show_level = false, is_deprecation = false) %} |
| 132 | +{% macro render_table(logs, category = '', show_level = false, is_deprecation = false) %} |
133 | 133 | {% import _self as helper %}
|
134 | 134 | {% set channel_is_defined = (logs|first).channel is defined %}
|
135 | 135 |
|
|
160 | 160 | <td class="font-normal text-small text-bold nowrap">{{ log.channel }}</td>
|
161 | 161 | {% endif %}
|
162 | 162 |
|
163 |
| - <td class="font-normal">{{ helper.render_log_message(loop.index, log, is_deprecation) }}</td> |
| 163 | + <td class="font-normal">{{ helper.render_log_message(category, loop.index, log, is_deprecation) }}</td> |
164 | 164 | </tr>
|
165 | 165 | {% endfor %}
|
166 | 166 | </tbody>
|
167 | 167 | </table>
|
168 | 168 | {% endmacro %}
|
169 | 169 |
|
170 |
| -{% macro render_log_message(log_index, log, is_deprecation = false) %} |
| 170 | +{% macro render_log_message(category, log_index, log, is_deprecation = false) %} |
171 | 171 | {{ log.message }}
|
172 | 172 |
|
173 | 173 | {% if is_deprecation %}
|
174 | 174 | {% set stack = log.context.stack|default([]) %}
|
175 |
| - {% set id = 'sf-call-stack-' ~ log_index %} |
| 175 | + {% set stack_id = 'sf-call-stack-' ~ category ~ '-' ~ log_index %} |
176 | 176 |
|
177 | 177 | {% if log.context.errorCount is defined %}
|
178 | 178 | <span class="text-small text-bold">({{ log.context.errorCount }} times)</span>
|
179 | 179 | {% endif %}
|
180 | 180 |
|
181 | 181 | {% if stack %}
|
182 |
| - <button class="btn-link text-small sf-toggle" data-toggle-selector="#{{ id }}" data-toggle-alt-content="Hide stack trace">Show stack trace</button> |
| 182 | + <button class="btn-link text-small sf-toggle" data-toggle-selector="#{{ stack_id }}" data-toggle-alt-content="Hide stack trace">Show stack trace</button> |
183 | 183 | {% endif %}
|
184 | 184 |
|
185 | 185 | {% for index, call in stack if index > 1 %}
|
186 | 186 | {% if index == 2 %}
|
187 |
| - <ul class="sf-call-stack hidden" id="{{ id }}"> |
| 187 | + <ul class="sf-call-stack hidden" id="{{ stack_id }}"> |
188 | 188 | {% endif %}
|
189 | 189 |
|
190 | 190 | {% if call.class is defined %}
|
|
212 | 212 | {% endfor %}
|
213 | 213 | {% else %}
|
214 | 214 | {% if log.context is defined and log.context is not empty %}
|
215 |
| - <span class="metadata"> |
216 |
| - <strong>Context</strong>: {{ log.context|json_encode(64 b-or 256)|replace({ |
217 |
| - '{"' : '{ "', '"}' : '" }', '":{' : '": {', '":"' : '": "', '","' : '", "' |
218 |
| - }) }} |
219 |
| - </span> |
| 215 | + {% set context_id = 'context-' ~ category ~ '-' ~ log_index %} |
| 216 | + {% set context_dump = profiler_dump(log.context) %} |
| 217 | + |
| 218 | + <div class="metadata"> |
| 219 | + <strong>Context</strong>: |
| 220 | + |
| 221 | + {% if context_dump|length > 120 %} |
| 222 | + {{ context_dump[:120] }} ... |
| 223 | + |
| 224 | + <a class="btn-link text-small sf-toggle" data-toggle-selector="#{{ context_id }}" data-toggle-alt-content="Hide full context">Show full context</a> |
| 225 | + |
| 226 | + <div id="{{ context_id }}" class="context"> |
| 227 | + <pre>{{ context_dump }}</pre> |
| 228 | + </div> |
| 229 | + {% else %} |
| 230 | + {{ context_dump }} |
| 231 | + {% endif %} |
| 232 | + </div> |
220 | 233 | {% endif %}
|
221 | 234 | {% endif %}
|
222 | 235 | {% endmacro %}
|
0 commit comments