Update query log to be more useful
This commit is contained in:
parent
adcd4166c6
commit
02533addb4
|
@ -5,7 +5,7 @@ require_once __DIR__ . '/database.php';
|
|||
define('VERSION', '1.2.5');
|
||||
define('BUILD', 'Reawaken');
|
||||
define('START', microtime(true));
|
||||
define('DEBUG', true);
|
||||
define('DEBUG', false);
|
||||
|
||||
/**
|
||||
* Open or get SQLite database connection.
|
||||
|
@ -213,7 +213,7 @@ function display($content, $title, bool $topnav = true, bool $leftnav = true, bo
|
|||
"numqueries" => db()->count,
|
||||
"version" => VERSION,
|
||||
"build" => BUILD,
|
||||
"querylog" => DEBUG ? '<pre>'.print_r(db()->log, true).'</pre>' : ''
|
||||
"querylog" => DEBUG ? db()->log : []
|
||||
]);
|
||||
|
||||
exit;
|
||||
|
|
|
@ -39,7 +39,13 @@
|
|||
<div>Version <?= $version ?> <?= $build ?></div>
|
||||
</footer>
|
||||
|
||||
<?= $querylog ?>
|
||||
<?php
|
||||
if (!empty($querylog)) {
|
||||
echo '<pre>';
|
||||
foreach ($querylog as $record) echo '<div>['.round($record[1], 2)."s] {$record[0]}</div>";
|
||||
echo '</pre>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue
Block a user