aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-14 16:47:51 -0700
committerzotlabs <mike@macgirvin.com>2018-04-14 16:47:51 -0700
commitfdf5799857d2f92f6ec7658d271fd3aab22768d5 (patch)
treed3ebe51dae209014a47885a596d3af5ceca3d720 /include
parentf16dc7afc8c7a866138511465a4d3362b704c33c (diff)
downloadvolse-hubzilla-fdf5799857d2f92f6ec7658d271fd3aab22768d5.tar.gz
volse-hubzilla-fdf5799857d2f92f6ec7658d271fd3aab22768d5.tar.bz2
volse-hubzilla-fdf5799857d2f92f6ec7658d271fd3aab22768d5.zip
allow dbg(2) to only return the canonical SQL used in the query and the number of results, but not log every single result. Maybe we should use 1 for this and 2 for the full results, but I didn't really want to change the way people do things today. If anybody has a strong opinion about doing this, go ahead and change it and send a note to the developer forum.
Diffstat (limited to 'include')
-rwxr-xr-xinclude/dba/dba_pdo.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index f24c5381a..9321fddd6 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -100,7 +100,9 @@ class dba_pdo extends dba_driver {
if($this->debug) {
db_logger('dba_pdo: DEBUG: ' . printable($sql) . ' returned ' . count($r) . ' results.', LOGGER_NORMAL, LOG_INFO);
- db_logger('dba_pdo: ' . printable(print_r($r,true)), LOGGER_NORMAL, LOG_INFO);
+ if(intval($this->debug) === 1) {
+ db_logger('dba_pdo: ' . printable(print_r($r,true)), LOGGER_NORMAL, LOG_INFO);
+ }
}
return (($this->error) ? false : $r);