summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorChristian Schneider2008-10-01 14:05:28 +0000
committerChristian Schneider2008-10-01 14:05:28 +0000
commit752b1bd0ed2bf16450f090d337b2e87b5e0e59c4 (patch)
tree3766ed8a8550a0bdc624cba40bf25b01b7f29f71 /it_dbi.class
parent13626f1556884806dbcc387b7268975de2c0aac4 (diff)
downloaditools-752b1bd0ed2bf16450f090d337b2e87b5e0e59c4.tar.gz
itools-752b1bd0ed2bf16450f090d337b2e87b5e0e59c4.tar.bz2
itools-752b1bd0ed2bf16450f090d337b2e87b5e0e59c4.zip
Added logging of querys to _sqllog if debug_sqllog is set
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class8
1 files changed, 7 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 356930e..c85b43f 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -418,7 +418,13 @@ function query($query, $p = array())
{
$end = gettimeofday();
$msec = round(($end['sec'] - $start['sec']) * 1000 + ($end['usec'] - $start['usec']) / 1000);
- it::log('sqllog', "$msec\t$query" . (EDC('sqltrace') ? "\t" . it_debug::backtrace(1) : ""));
+ $backtrace = EDC('sqltrace') ? it_debug::backtrace(1) : null;
+ it::log('sqllog', rtrim("$msec\t$query\t$backtrace"));
+
+ $this->_sqllog[] = array(
+ 'time' => $msec,
+ 'query' => $query,
+ ) + ($backtrace ? array('backtrace' => $backtrace) : array());
}
return $result;