From fdf5799857d2f92f6ec7658d271fd3aab22768d5 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 14 Apr 2018 16:47:51 -0700 Subject: 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. --- include/dba/dba_pdo.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/dba/dba_pdo.php') 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); -- cgit v1.2.3