diff options
-rw-r--r-- | it_dbi.class | 8 |
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; |