修正Log类

This commit is contained in:
thinkphp
2017-11-22 13:51:04 +08:00
parent dd7ea2fad5
commit a1abcebbd8

View File

@@ -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 {