mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
Log类异常判断调整
This commit is contained in:
@@ -21,12 +21,8 @@ class Log {
|
|||||||
static public function init($config=[]){
|
static public function init($config=[]){
|
||||||
$type = isset($config['type'])?$config['type']:'File';
|
$type = isset($config['type'])?$config['type']:'File';
|
||||||
$class = 'Think\\Log\\Driver\\'. ucwords($type);
|
$class = 'Think\\Log\\Driver\\'. ucwords($type);
|
||||||
if(class_exists($class)) {
|
unset($config['type']);
|
||||||
unset($config['type']);
|
self::$storage = new $class($config);
|
||||||
self::$storage = new $class($config);
|
|
||||||
}else{
|
|
||||||
throw new \Exception('Log type not exists:'.$type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -40,7 +36,7 @@ class Log {
|
|||||||
static public function record($message,$level='INFO') {
|
static public function record($message,$level='INFO') {
|
||||||
self::$log[$level][] = "{$level}: {$message}";
|
self::$log[$level][] = "{$level}: {$message}";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取内存中的日志信息
|
* 获取内存中的日志信息
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
Reference in New Issue
Block a user