diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-14 16:47:51 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-14 16:47:51 -0700 |
commit | fdf5799857d2f92f6ec7658d271fd3aab22768d5 (patch) | |
tree | d3ebe51dae209014a47885a596d3af5ceca3d720 /include/dba/dba_pdo.php | |
parent | f16dc7afc8c7a866138511465a4d3362b704c33c (diff) | |
download | volse-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/dba/dba_pdo.php')
-rwxr-xr-x | include/dba/dba_pdo.php | 4 |
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); |