改进日志类的trace驱动

This commit is contained in:
thinkphp
2015-12-21 17:53:22 +08:00
parent c0ef3e48a6
commit 4d735fb03e

View File

@@ -35,7 +35,10 @@ class Trace
*/ */
public function save($log = []) public function save($log = [])
{ {
if(IS_AJAX) return; if (IS_AJAX || IS_CLI || IS_API) {
// ajax cli api方式下不输出
return;
}
// 获取基本信息 // 获取基本信息
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$runtime = number_format(microtime(true) - START_TIME, 6); $runtime = number_format(microtime(true) - START_TIME, 6);