summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
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;