diff options
author | Christian Schneider | 2008-10-01 14:05:28 +0000 |
---|---|---|
committer | Christian Schneider | 2008-10-01 14:05:28 +0000 |
commit | 752b1bd0ed2bf16450f090d337b2e87b5e0e59c4 (patch) | |
tree | 3766ed8a8550a0bdc624cba40bf25b01b7f29f71 /it_dbi.class | |
parent | 13626f1556884806dbcc387b7268975de2c0aac4 (diff) | |
download | itools-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.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; |