tp 日志生成器
   /**
 * 日志生成器
 * @param  [type] $content [description]
 * @return [type]          [description]
 */
  private function log($content)
 {
     $this->msg[] = $content;
     $log_file = app()->getRuntimePath() . "log/stage" . DIRECTORY_SEPARATOR . 'stage-' . date('Ymd', time()) . ".log";
     $path = dirname($log_file);
     !is_dir($path) && mkdir($path, 0755, true);
     file_put_contents($log_file, date('Y-m-d H:i:s') . "\n" . $content . "\n", FILE_APPEND | LOCK_EX);
 }
posted on 2020-11-06 10:12  李柯游  阅读(177)  评论(0)    收藏  举报