mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
修正trace方法和trace驱动
This commit is contained in:
@@ -271,7 +271,7 @@ function S($name, $value = '', $options = null)
|
|||||||
*/
|
*/
|
||||||
function trace($log = '[think]', $level = 'log')
|
function trace($log = '[think]', $level = 'log')
|
||||||
{
|
{
|
||||||
if ('[think]' == $log) {
|
if ('[think]' === $log) {
|
||||||
return \think\Log::getLog();
|
return \think\Log::getLog();
|
||||||
} else {
|
} else {
|
||||||
\think\Log::record($log, $level);
|
\think\Log::record($log, $level);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class Log
|
|||||||
public static function record($msg, $type = 'log')
|
public static function record($msg, $type = 'log')
|
||||||
{
|
{
|
||||||
if (!is_string($msg)) {
|
if (!is_string($msg)) {
|
||||||
$msg = print_r($msg, true);
|
$msg = var_export($msg, true);
|
||||||
}
|
}
|
||||||
self::$log[] = ['type' => $type, 'msg' => $msg];
|
self::$log[] = ['type' => $type, 'msg' => $msg];
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ class Log
|
|||||||
public static function write($msg, $type = 'log')
|
public static function write($msg, $type = 'log')
|
||||||
{
|
{
|
||||||
if (!is_string($msg)) {
|
if (!is_string($msg)) {
|
||||||
$msg = print_r($msg, true);
|
$msg = var_export($msg, true);
|
||||||
}
|
}
|
||||||
// 封装日志信息
|
// 封装日志信息
|
||||||
$log[] = ['type' => $type, 'msg' => $msg];
|
$log[] = ['type' => $type, 'msg' => $msg];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace think\log\driver;
|
|||||||
*/
|
*/
|
||||||
class Trace
|
class Trace
|
||||||
{
|
{
|
||||||
protected $tabs = ['base' => '基本', 'file' => '文件', 'warn|error' => '错误', 'sql' => 'SQL', 'info|debug|log' => '调试'];
|
protected $tabs = ['base' => '基本', 'file' => '文件', 'notic|error' => '错误', 'sql' => 'SQL', 'info|debug|log' => '调试'];
|
||||||
protected $config = [
|
protected $config = [
|
||||||
'trace_file' => '',
|
'trace_file' => '',
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user