...
|
...
|
@@ -33,7 +33,7 @@ class Log { |
|
|
*/
|
|
|
public function __construct()
|
|
|
{
|
|
|
$this->filename['default'] = LOG_PATH.'/'.app()->nowDate().'.error.log';
|
|
|
$this->setFilename();
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -48,7 +48,7 @@ class Log { |
|
|
self::getInstance()->setFilename($filename);
|
|
|
}
|
|
|
|
|
|
self::getInstance()->message[md5($filename)][] = $message;
|
|
|
self::getInstance()->message[$filename ? md5($filename) : 'default'][] = $message;
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -71,16 +71,18 @@ class Log { |
|
|
* @author:dc
|
|
|
* @time 2023/3/14 11:11
|
|
|
*/
|
|
|
private function setFilename($filename){
|
|
|
private function setFilename($filename=null){
|
|
|
if($filename){
|
|
|
$this->filename[md5($filename)] = $filename;
|
|
|
}else{
|
|
|
$this->filename['default'] = $filename = LOG_PATH.'/'.app()->nowDate().'.error.log';
|
|
|
}
|
|
|
|
|
|
// 创建目录
|
|
|
if(!is_dir(dirname($filename))){
|
|
|
@mkdir(dirname($filename),0755,true);
|
|
|
}
|
|
|
|
|
|
$this->filename[md5($filename)] = $filename;
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|