|
88 | 88 |
|
89 | 89 | {% if collector.logs %}
|
90 | 90 | <ul class="alt">
|
91 |
| - {% for log in collector.logs if priority >= 0 and log.priority >= priority or priority < 0 and log.context.type|default(0) == priority %} |
92 |
| - <li class="{{ cycle(['odd', 'even'], loop.index) }}{% if log.priority >= 400 %} error{% elseif log.priority >= 300 %} warning{% endif %}{% if log.context.scream is defined %} scream{% endif %}"> |
93 |
| - {{ logger.display_message(loop.index, log) }} |
94 |
| - </li> |
| 91 | + {% for log in collector.logs %} |
| 92 | + {% 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) %} |
| 93 | + {% if priority == '-100' ? is_deprecation : log.priority >= priority %} |
| 94 | + <li class="{{ cycle(['odd', 'even'], loop.index) }}{% if log.context.scream is defined %} scream{% elseif log.priority >= 400 %} error{% elseif log.priority >= 300 %} warning{% endif %}"> |
| 95 | + {{ logger.display_message(loop.index, log, is_deprecation) }} |
| 96 | + </li> |
| 97 | + {% endif %} |
95 | 98 | {% else %}
|
96 | 99 | <li><em>No logs available for this priority.</em></li>
|
97 | 100 | {% endfor %}
|
|
104 | 107 | {% endblock %}
|
105 | 108 |
|
106 | 109 |
|
107 |
| -{% macro display_message(log_index, log) %} |
108 |
| - {% if 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) %} |
109 |
| - DEPRECATION - {{ log.message }} |
110 |
| - {% set id = 'sf-call-stack-' ~ log_index %} |
111 |
| - <a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;"> |
112 |
| - <img class="toggle" id="{{ id }}-off" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display:none"> |
113 |
| - <img class="toggle" id="{{ id }}-on" alt="+" src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7" style="display:inline"> |
114 |
| - </a> |
115 |
| - {% for index, call in log.context.stack if index > 1 %} |
| 110 | +{% macro display_message(log_index, log, is_deprecation) %} |
| 111 | + {% if is_deprecation %} |
| 112 | + {% set stack = log.context.stack|default([]) %} |
| 113 | + |
| 114 | + {% if stack %} |
| 115 | + <a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;"> |
| 116 | + <img class="toggle" id="{{ id }}-off" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display:none"> |
| 117 | + <img class="toggle" id="{{ id }}-on" alt="+" src="data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7" style="display:inline"> |
| 118 | + </a> |
| 119 | + {% endif %} |
| 120 | + |
| 121 | + {% for index, call in stack if index > 1 %} |
116 | 122 | {% if index == 2 %}
|
117 | 123 | <ul class="sf-call-stack" id="{{ id }}" style="display: none">
|
118 | 124 | {% endif %}
|
|
128 | 134 |
|
129 | 135 | <li>Called from {{ call.file is defined and call.line is defined ? call.file|format_file(call.line, from) : from|raw }}</li>
|
130 | 136 |
|
131 |
| - {% if index == log.context.stack|length - 1 %} |
| 137 | + {% if index == stack|length - 1 %} |
132 | 138 | </ul>
|
133 | 139 | {% endif %}
|
134 | 140 | {% endfor %}
|
|
0 commit comments