From ae72fd7e1013ade3243a74e6f2a7e5991daacdf2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 27 Dec 2015 20:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=ABwarn?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=BAnotic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/error.php | 2 +- library/think/loader.php | 2 +- library/think/log.php | 4 ++-- library/think/log/driver/socket.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/error.php b/library/think/error.php index 6b0fd9f1..688e8b52 100644 --- a/library/think/error.php +++ b/library/think/error.php @@ -53,7 +53,7 @@ class Error case E_USER_WARNING: case E_USER_NOTICE: default: - Log::record($errorStr, 'warn'); + Log::record($errorStr, 'notic'); break; } } diff --git a/library/think/loader.php b/library/think/loader.php index c0c2748b..34a0608f 100644 --- a/library/think/loader.php +++ b/library/think/loader.php @@ -265,7 +265,7 @@ class Loader if (class_exists($class)) { $model = new $class($name); } else { - Log::record('实例化不存在的类:' . $class, 'warn'); + Log::record('实例化不存在的类:' . $class, 'notic'); $model = new Model($name); } } diff --git a/library/think/log.php b/library/think/log.php index 55d73faf..b97a829f 100644 --- a/library/think/log.php +++ b/library/think/log.php @@ -17,13 +17,13 @@ class Log const ERROR = 'error'; const INFO = 'info'; const SQL = 'sql'; - const WARN = 'warn'; + const NOTIC = 'notic'; const ALERT = 'alert'; // 日志信息 protected static $log = []; // 日志类型 - protected static $type = ['log', 'error', 'info', 'sql', 'warn', 'alert']; + protected static $type = ['log', 'error', 'info', 'sql', 'notic', 'alert']; // 日志写入驱动 protected static $driver = null; // 通知发送驱动 diff --git a/library/think/log/driver/socket.php b/library/think/log/driver/socket.php index 1c77b202..058c1f17 100644 --- a/library/think/log/driver/socket.php +++ b/library/think/log/driver/socket.php @@ -88,7 +88,7 @@ class Socket ]; foreach ($logs as &$log) { - if (in_array($log['type'], ['sql', 'debug', 'info'])) { + if (in_array($log['type'], ['sql', 'notic', 'debug', 'info'])) { $log['type'] = 'log'; } }