Commit 285b276b authored by 刘小敏's avatar 刘小敏

AI视频队列程序日志优化;

parent ab7732df
...@@ -226,6 +226,7 @@ class AiTryon extends Common ...@@ -226,6 +226,7 @@ class AiTryon extends Common
$user = auth_user(); $user = auth_user();
// \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260506113558-x6wtq', 'user' => $user], 'shopro-high'); // \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260506113558-x6wtq', 'user' => $user], 'shopro-high');
// $this->success('推送队列成功'); // $this->success('推送队列成功');
// exit; // exit;
......
...@@ -926,9 +926,8 @@ if (!function_exists('operate_disabled')) { ...@@ -926,9 +926,8 @@ if (!function_exists('operate_disabled')) {
// 调试输出 // 调试输出
if (!function_exists('debug_echo')) { if (!function_exists('debug_echo')) {
function debug_echo($text='') function debug_echo($text='', $name='gen_ai')
{ {
echo PHP_EOL . '------' . $text . '------' . PHP_EOL ; echo PHP_EOL . '------' . $text . '------' . PHP_EOL ;
\think\Log::info($text);
} }
} }
This diff is collapsed.
...@@ -507,3 +507,23 @@ EOT; ...@@ -507,3 +507,23 @@ EOT;
return $icon; return $icon;
} }
} }
if (!function_exists('custom_log')) {
/**
* 自定义日志文件名
* @param string $content 日志内容
* @param string $name 文件名(不需要 .log)
* @param string $level 级别 info/error/debug
*/
function custom_log($content, $name = 'custom', $level = 'info')
{
\think\Log::init([
'type' => 'File',
'path' => RUNTIME_PATH . 'log/'.date('Ym').'/',
'single' => $name.'_'.date('Ymd').'_',
'max_files' => 0,
]);
\think\Log::record($content, $level);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment