ecoco/magento_profiler

View on GitHub
app/design/frontend/base/default/template/ecocode_profiler/collector/log/panel.phtml

Summary

Maintainability
Test Coverage
<?php
/** @var Ecocode_Profiler_Block_Collector_Log_Panel $this */

/** @var Ecocode_Profiler_Model_Collector_LogDataCollector $collector */
$collector = $this->getCollector();
?>

<h2>Log Messages</h2>

<?php if (Mage::getLogger() === false): ?>
    <div class="empty status-error">
        <p>No log messages available as the "monolog/monolog" is not installed please check the composer.json</p>
    </div>
<?php elseif (!$collector->getLogs()): ?>
    <div class="empty">
        <p>No log messages available.</p>
    </div>
<?php else: ?>
    <div class="sf-tabs">
        <?php $showLevel = true;?>
        <?php $groups = $this->getLogGroups();?>
        <div class="tab">
            <h3 class="tab-title">Info. &amp; Errors <span class="badge"><?php echo count($groups['info_and_error']); ?></span></h3>

            <div class="tab-content">
                <?php if (!$groups['info_and_error']): ?>
                    <div class="empty">
                        <p>There are no log messages of this level.</p>
                    </div>
                <?php else: ?>
                    <?php echo $this->renderLogTable($groups['info_and_error'], 'info', true); ?>
                <?php endif;?>
            </div>
        </div>

        <div class="tab">
            <h3 class="tab-title">Deprecations <span class="badge"><?php echo $collector->countDeprecations()?></span></h3>

            <div class="tab-content">
                <?php if (empty($groups['deprecation'])): ?>
                <div class="empty">
                    <p>There are no log messages about deprecated features.</p>
                </div>
                <?php else: ?>
                    <?php echo $this->renderLogTable($groups['deprecation'], 'deprecation', false, true); ?>
                <?php endif;?>
            </div>
        </div>

        <div class="tab">
            <h3 class="tab-title">Debug <span class="badge"><?php echo count($groups['debug'])?></span></h3>

            <div class="tab-content">
                <?php if (empty($groups['debug'])): ?>
                <div class="empty">
                    <p><p>There are no log messages of this level.</p>
                </div>
                <?php else: ?>
                    <?php echo $this->renderLogTable($groups['debug'], 'debug'); ?>
                <?php endif;?>
            </div>
        </div>

        <div class="tab">
            <h3 class="tab-title">Silenced Errors  <span class="badge"><?php echo $collector->countScreams() ?></span></h3>

            <div class="tab-content">
                <?php if (empty($groups['silenced'])): ?>
                <div class="empty">
                    <p><p>There are no log messages of this level.</p>
                </div>
                <?php else: ?>
                    <?php echo $this->renderLogTable($groups['silenced'], 'silenced'); ?>
                <?php endif;?>
            </div>
        </div>

        <?php /* foreach ($this->getLogGroups() as $groupName => $logs): ?>
            <div class="tab">
                <h3 class="tab-title">
                    <?php echo $groupData['name'] ?>
                    <span class="badge"><?php echo count($groupData['logs']); ?></span><br>
                </h3>

                <div class="tab-content">
                    <small><?php echo $groupData['file']; ?></small>
                    <table class="logs">
                        <thead>
                        <tr>
                            <th>Level</th>
                            <th>Message</th>
                        </tr>
                        </thead>

                        <tbody>
                        <?php foreach ($groupData['logs'] as $index => $entry): ?>
                            <?php
                            $level    = $entry['level'];
                            $cssClass = $this->getEntryCssClass($entry['level']);
                            ?>

                            <tr class="<?php echo $cssClass; ?>">
                                <td class="font-normal text-small">
                                <span
                                    class="colored text-bold nowrap"><?php echo $this->getPriorityName($level) ?></span>
                                    <!--<span class="text-muted nowrap newline">{{ log.timestamp|date('H:i:s') }}</span>-->
                                </td>

                                <td class="font-normal"><?php echo $entry['message'] ?></td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        <?php endforeach; */?>
    </div>
<?php endif; ?>