mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
#17605348 * debugPrint()에 FirePHP 연동 추가
* PHP 5.2 이상에서 작동. 만족하지 못하면 _debug_message.php 파일에 작성됨 * FirePHP 파이어폭스 플러그인 필요함. https://addons.mozilla.org/en-US/firefox/addon/6149 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5221 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9c4c6d5de5
commit
935d26cf8d
5 changed files with 157 additions and 1428 deletions
|
|
@ -145,26 +145,29 @@
|
|||
$this->elapsed_time = $elapsed_time;
|
||||
$GLOBALS['__db_elapsed_time__'] += $elapsed_time;
|
||||
|
||||
$str = sprintf("\t%02d. %s (%0.6f sec)\n", ++$GLOBALS['__dbcnt'], $this->query, $elapsed_time);
|
||||
$log['query'] = $this->query;
|
||||
$log['elapsed_time'] = $elapsed_time;
|
||||
|
||||
// 에러 발생시 에러 로그를 남김 (__DEBUG_DB_OUTPUT__이 지정되어 있을경우)
|
||||
if($this->isError()) {
|
||||
$str .= sprintf("\t Query Failed : %d\n\t\t\t %s\n", $this->errno, $this->errstr);
|
||||
$log['result'] = 'Failed';
|
||||
$log['errno'] = $this->errno;
|
||||
$log['errstr'] = $this->errstr;
|
||||
|
||||
if(__DEBUG_DB_OUTPUT__==1) {
|
||||
if(__DEBUG_DB_OUTPUT__ == 1) {
|
||||
$debug_file = _XE_PATH_."files/_debug_db_query.php";
|
||||
$buff = sprintf("%s\n",print_r($str,true));
|
||||
|
||||
if($display_line) $buff = "\n====================================\n".$buff."------------------------------------\n";
|
||||
if($display_line) $buff = "\n<?php\n/*\n====================================\n".$buff."------------------------------------\n*/\n?>\n";
|
||||
|
||||
if(@!$fp = fopen($debug_file,"a")) return;
|
||||
fwrite($fp, $buff);
|
||||
fclose($fp);
|
||||
}
|
||||
} else {
|
||||
$str .= "\t Query Success\n";
|
||||
$log['result'] = 'Success';
|
||||
}
|
||||
$GLOBALS['__db_queries__'] .= $str;
|
||||
$GLOBALS['__db_queries__'][] = $log;
|
||||
|
||||
// __LOG_SLOW_QUERY__ 가 정해져 있다면 시간 체크후 쿼리 로그 남김
|
||||
if(__LOG_SLOW_QUERY__>0 && $elapsed_time > __LOG_SLOW_QUERY__) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue