ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
` ~~~ /** * @param $param //参数,内容 * @param string $root //日志地址 * @describe:日志打印 */ function writeLog($param, $root = "") { $filename = date("Y_m_d", time()); if (empty($root)) { $myfile = $filename . ".txt"; } else { $f = ROOT_PATH . 'Logs/' . $root . "/"; if (!is_dir($f)) { @mkdir($f, 0777, true); } $myfile = ROOT_PATH . 'Logs/' . $root . "/" . $filename . ".txt"; } if (is_array($param)) { $param = json_encode($param, $param, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE); } @file_put_contents( $myfile, "执行日期:" . "\r\n" . date('Y-m-d H:i:s', time()) . ' ' . "\n" . $param . "\r\n", FILE_APPEND ); } ~~~ `