mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1194 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4ecfe64485
commit
4c123b4395
9 changed files with 63 additions and 34 deletions
|
|
@ -16,13 +16,22 @@
|
|||
require_once("./config/func.inc.php");
|
||||
|
||||
/**
|
||||
* @brief debug mode = true 일때 files/_debug_message.php 에 디버그 내용이 쌓임
|
||||
* @brief 디버그 메세지의 출력 장소
|
||||
* 0 : files/_debug_message.php 에 연결하여 출력
|
||||
* 1 : Response Method 가 XML 형식이 아닐 경우 브라우저에 최상단에 주석으로 표시
|
||||
**/
|
||||
define('__DEBUG__', true);
|
||||
if(__DEBUG__) {
|
||||
// 여기서부터 시작 시간으로 설정
|
||||
define('__StartTime__', getMicroTime());
|
||||
}
|
||||
define('__DEBUG_OUTPUT__', 1);
|
||||
|
||||
/**
|
||||
* @brief 디버깅 메세지 출력
|
||||
* 0 : 디버그 메세지를 생성/ 출력하지 않음
|
||||
* 1 : 전체 실행 시간에 대해서만 메세지 생성/ 출력
|
||||
* 2 : 1 + DB 쿼리
|
||||
* 3 : 모든 로그
|
||||
**/
|
||||
define('__DEBUG__', 3);
|
||||
|
||||
if(__DEBUG__) define('__StartTime__', getMicroTime());
|
||||
|
||||
/**
|
||||
* @brief 기본적인 class 파일 include
|
||||
|
|
|
|||
|
|
@ -140,15 +140,21 @@
|
|||
* tail -f ./files/_debug_message.php 하여 계속 살펴 볼 수 있다
|
||||
**/
|
||||
function debugPrint($buff = null, $display_line = true) {
|
||||
if($buff == null) $buff = $GLOBALS['HTTP_RAW_POST_DATA'];
|
||||
$debug_file = "./files/_debug_message.php";
|
||||
$buff = sprintf("%s\n",print_r($buff,true));
|
||||
if(!$buff) return;
|
||||
|
||||
if($display_line) $buff = "\n====================================\n".$buff."------------------------------------\n";
|
||||
if(__DEBUG_OUTPUT__==1) {
|
||||
$header = sprintf("<!--\n%s\n-->", print_r($buff,true));
|
||||
Context::addHtmlHeader($header);
|
||||
} else {
|
||||
$debug_file = "./files/_debug_message.php";
|
||||
$buff = sprintf("%s\n",print_r($buff,true));
|
||||
|
||||
if(@!$fp = fopen($debug_file,"a")) return;
|
||||
fwrite($fp, $buff);
|
||||
fclose($fp);
|
||||
if($display_line) $buff = "\n====================================\n".$buff."------------------------------------\n";
|
||||
|
||||
if(@!$fp = fopen($debug_file,"a")) return;
|
||||
fwrite($fp, $buff);
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue