From 54d09582371d41bfd3d2cf62ab689d05d9211817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BA=A6=E5=BD=93=E8=8B=97=E5=84=BF?= Date: Mon, 15 Apr 2013 14:34:48 +0800 Subject: [PATCH] =?UTF-8?q?Log=E7=B1=BB=E5=BC=82=E5=B8=B8=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Think/Log.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Library/Think/Log.php b/Library/Think/Log.php index 748f2df3..f608f7e6 100644 --- a/Library/Think/Log.php +++ b/Library/Think/Log.php @@ -21,12 +21,8 @@ class Log { static public function init($config=[]){ $type = isset($config['type'])?$config['type']:'File'; $class = 'Think\\Log\\Driver\\'. ucwords($type); - if(class_exists($class)) { - unset($config['type']); - self::$storage = new $class($config); - }else{ - throw new \Exception('Log type not exists:'.$type); - } + unset($config['type']); + self::$storage = new $class($config); } /** @@ -40,7 +36,7 @@ class Log { static public function record($message,$level='INFO') { self::$log[$level][] = "{$level}: {$message}"; } - + /** * 获取内存中的日志信息 * @access public