Added optional SQL queries debug

This commit is contained in:
Marcin Kurczewski 2013-10-19 12:53:49 +02:00
parent 5d51297c16
commit 4b5c13519c
3 changed files with 12 additions and 4 deletions

View file

@ -8,6 +8,7 @@ filesPath=./files/
thumbsPath=./thumbs/ thumbsPath=./thumbs/
mediaPath=./public_html/media/ mediaPath=./public_html/media/
title=szurubooru title=szurubooru
debugQueries=0
[browsing] [browsing]
usersPerPage=8 usersPerPage=8

View file

@ -115,7 +115,7 @@ body {
footer { footer {
text-align: center; text-align: center;
margin-top: 1em; margin: 1em 0;
padding-top: 0.5em; padding-top: 0.5em;
border-top: 1px solid #eee; border-top: 1px solid #eee;
font-size: small; font-size: small;
@ -306,3 +306,8 @@ button:hover {
display: block; display: block;
clear: both; clear: both;
} }
pre.debug {
text-align: left;
color: black;
}

View file

@ -98,9 +98,11 @@
<footer> <footer>
<div class="main-wrapper"> <div class="main-wrapper">
Load: <?php echo sprintf('%.05f', microtime(true) - trueStartTime()) ?>s <span>Load: <?php echo sprintf('%.05f', microtime(true) - trueStartTime()) ?>s</span>
&nbsp; <span>Queries: <?php echo count(queryLogger()->getLogs()) ?></span>
Queries: <?php echo count(queryLogger()->getLogs()) ?> <?php if ($this->config->main->debugQueries): ?>
<pre class="debug"><?php echo join('<br>', array_map(function($x) { return preg_replace('/\s+/', ' ', $x); }, queryLogger()->getLogs())) ?></pre>
<?php endif ?>
</div> </div>
</footer> </footer>
</body> </body>