//参数1:类型,参数2:code(定位),其它参数:值 public function L() { $file = dirname(__FILE__)."/../../../Apps/".MODULE_NAME."/Log/".CONTROLLER_NAME.".txt"; $var_arr = func_get_args(); $content_arr = array(); foreach($var_arr as $k=>$value){ if(!$k){ $type = $value; continue; } if(1==$k){ $code = $value; continue; } $value = json_encode($value); $content_arr[] = $value; } if(!isset($type) || !isset($code)) return; $content = implode(" - ", $content_arr); $error_content = "【".$type."({$code})】-".date(‘Y-m-d H:i:s‘).":".$content."\r\n"; if( \Think\Storage::has($file) ){ $content = $str.\Think\Storage::read($file); } return \Think\Storage::put($file,$error_content); }
private function L(){ $var_arr = func_get_args(); $content_arr = array(); foreach($var_arr as $k=>$value){ if(!$k){ $type = $value; continue; } if(1==$k){ $code = $value; continue; } //if(is_array($value) || is_object($value)){ $value = json_encode($value); //} $content_arr[] = $value; } if(!isset($type) || !isset($code)) return; $content = implode(" - ", $content_arr); $error_content = "【".$type."({$code})】-".date(‘Y-m-d H:i:s‘).":".$content."\r\n"; error_log($error_content, 3, $this->log); }
时间: 2024-12-30 02:51:20