Show logs through the web interface
parent
164c1c78b3
commit
dccbbb98e5
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_startup_errors', 'On');
|
||||
ini_set('display_errors', 'On');
|
||||
|
||||
// register an autoloader to automatically load classes
|
||||
// the namespace for the class must begin with BSR and
|
||||
// otherwise respect the PSR-4 standard
|
||||
spl_autoload_register(function ($class) {
|
||||
$class = substr($class, strlen('BSR'));
|
||||
$path = sprintf('%s/../%s.php', __DIR__, str_replace('\\', '/', $class));
|
||||
|
||||
if (file_exists($path)) {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require $path;
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace BSR;
|
||||
|
||||
use BSR\Lib\Formatter\Html;
|
||||
use BSR\Lib\Logger;
|
||||
|
||||
require_once('Lib/autoloader.php');
|
||||
|
||||
$logs = Logger::getLastLogs();
|
||||
|
||||
echo Html::template(array(
|
||||
'title' => 'Logs',
|
||||
'content' => "<pre>$logs</pre>",
|
||||
));
|
||||
Loading…
Reference in New Issue