From 02533addb410c9919545ef20403a4fa43a79a5cc Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Sat, 14 Dec 2024 14:12:14 -0600 Subject: [PATCH] Update query log to be more useful --- src/lib.php | 4 ++-- templates/primary.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib.php b/src/lib.php index c714063..69d3e19 100644 --- a/src/lib.php +++ b/src/lib.php @@ -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 ? '
'.print_r(db()->log, true).'
' : '' + "querylog" => DEBUG ? db()->log : [] ]); exit; diff --git a/templates/primary.php b/templates/primary.php index ba03c8f..e6b42cc 100644 --- a/templates/primary.php +++ b/templates/primary.php @@ -39,7 +39,13 @@
Version
- + '; + foreach ($querylog as $record) echo '
['.round($record[1], 2)."s] {$record[0]}
"; + echo ''; + } + ?>