From 211b28706f6bdbd959079dfe2e9d855581d1cbc8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 30 Nov 2016 15:33:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0debug=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E4=BB=85=E9=99=90=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Log.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/Log.php b/library/think/Log.php index 5fd1631a..cdeccba9 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -32,13 +32,14 @@ class Log const SQL = 'sql'; const NOTICE = 'notice'; const ALERT = 'alert'; + const DEBUG = 'debug'; // 日志信息 protected static $log = []; // 配置参数 protected static $config = []; // 日志类型 - protected static $type = ['log', 'error', 'info', 'sql', 'notice', 'alert']; + protected static $type = ['log', 'error', 'info', 'sql', 'notice', 'alert', 'debug']; // 日志写入驱动 protected static $driver; @@ -136,6 +137,9 @@ class Log if (empty(self::$config['level'])) { // 获取全部日志 $log = self::$log; + if (!App::$debug && isset($log['debug'])) { + unset($log['debug']); + } } else { // 记录允许级别 $log = [];