예제 #1
0
파일: FileLogger.php 프로젝트: jl9n/CuteLib
 /**
  * 构造函数,设置文件位置和过滤级别
  * @param string $name 日志名称
  * @param string $directory 日志目录
  * @param string $threshold 过滤级别(低于本级别的不记录)
  */
 public function __construct($name = '', $directory = false, $threshold = false)
 {
     $this->filename = ($name ? $name . '_' : '') . '%s.log';
     if ($directory === false) {
         $directory = realpath('./logs');
     }
     if (is_dir($directory) || mkdir($directory, 0777, true)) {
         $this->filename = $directory . DIRECTORY_SEPARATOR . $this->filename;
     }
     parent::__construct($threshold);
     $this->defer();
 }
예제 #2
0
파일: cutelib.php 프로젝트: jl9n/CuteLib
 function __construct($A = '', $r = false, $hC = false)
 {
     $this->filename = ($A ? $A . '_' : '') . '%s.log';
     if ($r === false) {
         $r = realpath('./logs');
     }
     if (is_dir($r) || mkdir($r, 0777, true)) {
         $this->filename = $r . DIRECTORY_SEPARATOR . $this->filename;
     }
     parent::__construct($hC);
     $this->defer();
 }