mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
@@ -1,5 +1,13 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yangweijie <yangweijiester@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace think\log\driver;
|
||||
use think\Cache;
|
||||
use think\Config;
|
||||
@@ -116,14 +124,11 @@ JS;
|
||||
foreach ($msg as $key => $m) {
|
||||
switch ($type) {
|
||||
case '调试':
|
||||
//我多么希望进来的是原数据格式而不是字符串
|
||||
if(substr($m, 0, 5) == 'array'){
|
||||
eval("\$o = $m;");
|
||||
$line[] = "console.log(".json_encode($o).");";
|
||||
$var_type = gettype($m);
|
||||
if(in_array($var_type, ['array', 'string'])){
|
||||
$line[] = "console.log(".json_encode($m).");";
|
||||
}else{
|
||||
$msg = addslashes($m);
|
||||
$msg = str_replace(PHP_EOL, '\n', $msg);
|
||||
$line[] = "console.log('$msg');";
|
||||
$line[] = "console.log(".json_encode(var_export($m, 1)).");";
|
||||
}
|
||||
break;
|
||||
case '错误':
|
||||
|
||||
Reference in New Issue
Block a user