From a1abcebbd8be741ee4e5b6577fad7f86eb58b7a1 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 22 Nov 2017 13:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Log=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Log.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Log.php b/library/think/Log.php index 6aa62a5e..e9d2bb58 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -67,12 +67,12 @@ class Log */ public static function init($config = []) { - self::$config = $config; - unset($config['type']); - $type = isset($config['type']) ? $config['type'] : 'File'; $class = false !== strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type); + self::$config = $config; + unset($config['type']); + if (class_exists($class)) { self::$driver = new $class($config); } else {