From 452993b3546e2c38676dbdafabc3b4593f9a129b Mon Sep 17 00:00:00 2001 From: wjcgithub Date: Mon, 5 Feb 2018 19:07:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E8=BE=93=E5=87=BAdebug?= =?UTF-8?q?=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/demo.php b/demo.php index 56b9675..f9fadb0 100644 --- a/demo.php +++ b/demo.php @@ -10,11 +10,13 @@ 'force_client_ids' => array(//日志强制记录到配置的client_id,默认为空,client_id必须在allow_client_ids中 //'client_01', //'client_02', + 'wjc' ), 'allow_client_ids' => array(//限制允许读取日志的client_id,默认为空,表示所有人都可以获得日志。 //'client_01', //'client_02', //'client_03', + 'wjc' ), ),'config'); @@ -28,6 +30,16 @@ slog('msg','alert');//将日志以alert方式弹出 slog('msg','log','color:red;font-size:20px;');//自定义日志的样式,第三个参数为css样式 +$i=5; +while($i){ + $typeArr = ['log','info','error','warn']; + $key = array_rand($typeArr,1); + echo $i; + slog(['hello word'.$i, 1, 2, [1,4,5]], $typeArr[$key]); + $i--; + sleep(1); +} + //调试sql /* $link=mysql_connect( 'localhost:3306' , 'root' , '123456' , true ) ; From 13bc49ca2896fcb0505b5499d965c762b2fbbedd Mon Sep 17 00:00:00 2001 From: wjcgithub Date: Mon, 5 Feb 2018 19:07:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E8=BE=93=E5=87=BAdebug?= =?UTF-8?q?=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/slog.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/php/slog.php b/php/slog.php index 54b13f2..9eb4b89 100644 --- a/php/slog.php +++ b/php/slog.php @@ -42,7 +42,10 @@ public static function __callStatic($method,$args) if(in_array($method,self::$log_types)) { array_unshift($args,$method); - return call_user_func_array(array(self::getInstance(),'record'),$args); + $ret = call_user_func_array(array(self::getInstance(),'record'),$args); + self::sendLog(); + self::$logs=[]; + return $ret; } } @@ -489,7 +492,7 @@ protected static function sendToClient($tabid, $client_id, $logs, $force_client_ public function __destruct() { - self::sendLog(); + // self::sendLog(); } } From 02dbe91754ed5776abd161974b024e19a0e0f53e Mon Sep 17 00:00:00 2001 From: wjcgithub Date: Mon, 5 Feb 2018 19:09:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E8=BE=93=E5=87=BAdebug?= =?UTF-8?q?=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo.php b/demo.php index f9fadb0..914f20f 100644 --- a/demo.php +++ b/demo.php @@ -10,13 +10,11 @@ 'force_client_ids' => array(//日志强制记录到配置的client_id,默认为空,client_id必须在allow_client_ids中 //'client_01', //'client_02', - 'wjc' ), 'allow_client_ids' => array(//限制允许读取日志的client_id,默认为空,表示所有人都可以获得日志。 //'client_01', //'client_02', //'client_03', - 'wjc' ), ),'config');