{% extends "loggerpanel/base.html" %}
{% load loggerpanel %}

{% block content %}
        {% if logger %}
         <h1 class="mt-5">Logger <code>{{logger_name}}</code></h1>

         <ul class="list-group list-group-flush">
           <li class="list-group-item">
               <span class="fw-bold">Name: </span>
               <code>{{logger.name}}</code>
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Level: </span>
               <code>{{logger.level | logger_level_name}}</code>
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Effective Level: </span>
               <code>{{ logger.getEffectiveLevel  | logger_level_name}}</code>
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Parent: </span>
               {% if logger.name == 'root' %}
               <code>N/A</code>
               {% else %}
               <a href="{{base_url}}{{logger.parent.name}}">{{ logger.parent.name}}</a>
               {% endif %}
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Propagate: </span>
               <code>{{ logger.propagate}}</code>
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Handlers: </span>
               <ul class="list-group list-group-flush">
               {% for handler in logger.handlers %}
                   <li class="list-group-item">
                       <div>
                           <span>Name: </span>
                           <code>{{handler.get_name}}</code>
                       </div>
                       <div>
                           <span>Class: </span>
                           <code>{{handler | class_name}}</code>
                       </div>
                       <div>
                           <span>Level: </span>
                           <code>{{handler.level | logger_level_name}}</code>
                       </div>
                       <div>
                           <span>Formatter: </span>
                           <code>{{handler.formatter}}</code>
                       </div>
                       <div>
                           <span>Stream: </span>
                           <code>{{handler.stream.name}}</code>
                       </div>
                   </li>
              {% endfor %}
               </ul>
           </li>
           </li>
           <li class="list-group-item">
               <span class="fw-bold">Disabled: </span>
               <code>{{ logger.disabled}}</code>
           </li>
        </ul>
        {% else %}
          <h1 class="mt-5">Logger Not Found</code></h1>
{% endif %}
{% endblock %}