mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
@@ -75,11 +75,9 @@ return [
|
||||
'think\Hook' => CORE_PATH . 'Hook' . EXT,
|
||||
'think\Lang' => CORE_PATH . 'Lang' . EXT,
|
||||
'think\Log' => CORE_PATH . 'Log' . EXT,
|
||||
'think\log\driver\Browser' => CORE_PATH . 'log' . DS . 'driver' . DS . 'Browser' . EXT,
|
||||
'think\log\driver\File' => CORE_PATH . 'log' . DS . 'driver' . DS . 'File' . EXT,
|
||||
'think\log\driver\Sae' => CORE_PATH . 'log' . DS . 'driver' . DS . 'Sae' . EXT,
|
||||
'think\log\driver\Socket' => CORE_PATH . 'log' . DS . 'driver' . DS . 'Socket' . EXT,
|
||||
'think\log\driver\Trace' => CORE_PATH . 'log' . DS . 'driver' . DS . 'Trace' . EXT,
|
||||
'think\Model' => CORE_PATH . 'Model' . EXT,
|
||||
'think\model\Merge' => CORE_PATH . 'model' . DS . 'Merge' . EXT,
|
||||
'think\model\Pivot' => CORE_PATH . 'model' . DS . 'Pivot' . EXT,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace think;
|
||||
use think\exception\ClassNotFoundException;
|
||||
|
||||
/**
|
||||
* Class Log
|
||||
@@ -53,7 +54,11 @@ class Log
|
||||
$class = false !== strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type);
|
||||
self::$config = $config;
|
||||
unset($config['type']);
|
||||
self::$driver = new $class($config);
|
||||
if(class_exists($class)) {
|
||||
self::$driver = new $class($config);
|
||||
} else {
|
||||
throw new ClassNotFoundException('class not exists:' . $class, $class);
|
||||
}
|
||||
// 记录初始化信息
|
||||
App::$debug && Log::record('[ LOG ] INIT ' . $type . ': ' . var_export($config, true), 'info');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user