PHP Classes

File: public/template/logger.php

Recommend this page to a friend!
  Classes of Josantonius   PHP Logger lib   public/template/logger.php   Download  
File: public/template/logger.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Logger lib
Log errors to files and display messages on a page
Author: By
Last change:
Date: 6 years ago
Size: 2,032 bytes
 

Contents

Class file image Download
<?php
/**
 * Php library to create logs easily and store them in Json format.
 *
 * @author Josantonius - hello@josantonius.com
 * @copyright Copyright (c)
 * @license https://opensource.org/licenses/MIT - The MIT License (MIT)
 * @link https://github.com/Josantonius/PHP-Logger
 * @since 1.1.2
 */

use Josantonius\Logger\Logger;
?>

<div class="jst-logger jst-card-log">

    <div class="jst-logs">

        <?php foreach (Logger::get() as $number => $log) :
           
$type = $log['type'];
           
$date = $log['date'];
           
$hour = $log['hour'];
           
$message = $log['message'];
           
$lowerType = strtolower($type);

            unset(
$log['type'], $log['date'], $log['hour'], $log['message']);
       
?>

            <p class="jst-log">
                <span id="log-<?= $number ?>" class="jst-log-line">
                    <span class="jst-c-gray">[<?= $date ?>] </span>
                    <span class="jst-c-gray">[<?= $hour ?>]</span>
                    <span class="jst-c-<?= $lowerType ?> jst-uppercase"><?= $type ?></span>
                    <span class="jst-message"><?= $message ?></span>
                </span>
               
                <?php foreach ($log as $key => $value) : ?>
<span class="jst-c-gray jst-no-display" data-log-<?= $number ?>=""><br>[<?= $date ?>] </span>
                    <span class="jst-c-gray jst-no-display" data-log-<?= $number ?>="">[<?= $hour ?>]</span>
                    <span class="jst-c-<?= $lowerType ?> jst-no-display jst-uppercase" data-log-<?= $number ?>="">
                        <?= $key ?>
</span>
                    <span class="jst-c-gray jst-no-display" data-log-<?= $number ?>=""> ? </span>
                    <span class="jst-no-display jst-message" data-log-<?= $number ?>=""><?= $value ?></span>

                <?php endforeach; ?>

            </p>

        <?php endforeach; ?>

        <div class="jst-clear"></div>

    </div>

</div>