From e2fe86e49f49cd4c978bd7a0beee89497e382e7d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 10 Jan 2016 11:30:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3trace=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=92=8Ctrace=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.php | 2 +- library/think/Log.php | 4 ++-- library/think/log/driver/Trace.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helper.php b/helper.php index 5a01dbeb..a7ea8374 100644 --- a/helper.php +++ b/helper.php @@ -271,7 +271,7 @@ function S($name, $value = '', $options = null) */ function trace($log = '[think]', $level = 'log') { - if ('[think]' == $log) { + if ('[think]' === $log) { return \think\Log::getLog(); } else { \think\Log::record($log, $level); diff --git a/library/think/Log.php b/library/think/Log.php index 588d6bca..1fbf5d98 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -65,7 +65,7 @@ class Log public static function record($msg, $type = 'log') { if (!is_string($msg)) { - $msg = print_r($msg, true); + $msg = var_export($msg, true); } self::$log[] = ['type' => $type, 'msg' => $msg]; } @@ -88,7 +88,7 @@ class Log public static function write($msg, $type = 'log') { if (!is_string($msg)) { - $msg = print_r($msg, true); + $msg = var_export($msg, true); } // 封装日志信息 $log[] = ['type' => $type, 'msg' => $msg]; diff --git a/library/think/log/driver/Trace.php b/library/think/log/driver/Trace.php index 473fce9e..ebb2d2fc 100644 --- a/library/think/log/driver/Trace.php +++ b/library/think/log/driver/Trace.php @@ -15,7 +15,7 @@ namespace think\log\driver; */ 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 = [ 'trace_file' => '', ];