mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
分组默认展开基本和调试和错误
This commit is contained in:
@@ -108,7 +108,11 @@ JS;
|
|||||||
|
|
||||||
public function output($type, $msg){
|
public function output($type, $msg){
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
$line[] = "console.group('{$type}');";
|
$trace_tabs = array_values($this->config['trace_tabs']);
|
||||||
|
$line[] = ($type == $trace_tabs[0] || '调试' == $type || '错误'== $type)?
|
||||||
|
"console.group('{$type}');"
|
||||||
|
:
|
||||||
|
"console.groupCollapsed('{$type}');";
|
||||||
foreach ($msg as $key => $m) {
|
foreach ($msg as $key => $m) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case '调试':
|
case '调试':
|
||||||
@@ -122,10 +126,11 @@ JS;
|
|||||||
$line[] = "console.log('$msg');";
|
$line[] = "console.log('$msg');";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'error':
|
case '错误':
|
||||||
$msg = str_replace(PHP_EOL, '\n', $m);
|
$msg = str_replace(PHP_EOL, '\n', $m);
|
||||||
$style = 'color:#F4006B;font-size:14px;';
|
$style = 'color:#F4006B;font-size:14px;';
|
||||||
$line[] = "console.log(\"%c{$msg}\", \"{$style}\");";
|
$line[] = "console.error(\"%c{$msg}\", \"{$style}\");";
|
||||||
|
// $line[] = "console.error(".json_encode(debug_backtrace()).");";
|
||||||
break;
|
break;
|
||||||
case 'sql':
|
case 'sql':
|
||||||
$msg = str_replace(PHP_EOL, '\n', $m);
|
$msg = str_replace(PHP_EOL, '\n', $m);
|
||||||
|
|||||||
Reference in New Issue
Block a user