예제 #1
0
파일: Log.php 프로젝트: lsc20051426/think
 public static function init($config = [])
 {
     $type = isset($config['type']) ? $config['type'] : 'File';
     $class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\driver\\') . ucwords($type);
     unset($config['type']);
     self::$driver = new $class($config);
 }
예제 #2
0
파일: Log.php 프로젝트: xuyi5918/ipensoft
 /**
  * 日志初始化
  * @return void
  */
 public static function init($config = [])
 {
     $type = isset($config['type']) ? $config['type'] : 'File';
     $class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\driver\\') . ucwords($type);
     unset($config['type']);
     self::$driver = new $class($config);
     // 记录初始化信息
     APP_DEBUG && Log::record('[ LOG ] INIT ' . $type . ': ' . var_export($config, true), 'info');
 }
예제 #3
0
파일: Log.php 프로젝트: GDdark/cici
 /**
  * 日志初始化
  * @param array $config
  */
 public static function init($config = [])
 {
     $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 {
         throw new ClassNotFoundException('class not exists:' . $class, $class);
     }
     // 记录初始化信息
     App::$debug && Log::record('[ LOG ] INIT ' . $type . ': ' . var_export($config, true), 'info');
 }