{% set channel_is_defined = (logs|first).channel is defined %}

<table class="logs">
    <thead>
        <tr>
            <th>Level</th>
            {% if channel_is_defined %}<th>Channel</th>{% endif %}
            <th class="full-width">Message</th>
        </tr>
    </thead>

    <tbody>
    {% for log in logs %}
        <tr class="status-{{ log.priority >= 400 ? 'error' : log.priority >= 300 ? 'warning' : 'normal' }}">
            <td class="text-small" nowrap>
                <span class="colored text-bold">{{ log.priorityName }}</span>
                <span class="text-muted newline">{{ log.timestamp|date('H:i:s') }}</span>
            </td>
            {% if channel_is_defined %}
                <td class="text-small text-bold nowrap">
                    {{ log.channel }}
                </td>
            {% endif %}
            <td>{{ log.message|format_log_message(log.context) }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
