#feature: update log format

This commit is contained in:
2026-01-19 15:42:44 +08:00
parent 0646c8612b
commit ddd0f531fd
9 changed files with 180 additions and 170 deletions

View File

@@ -15,15 +15,15 @@ class ScheduledTaskRefreshCommand extends Command
public function handle(ScheduledTaskService $taskService): int
{
try {
Log::info('开始刷新定时任务列表...');
Log::channel('scheduled-tasks')->info('开始刷新定时任务列表...');
$tasks = $taskService->getAllTasks();
Log::info(sprintf('成功刷新 %d 个定时任务', count($tasks)));
Log::channel('scheduled-tasks')->info(sprintf('成功刷新 %d 个定时任务', count($tasks)));
// 记录任务列表到日志
// 显示任务列表
foreach ($tasks as $task) {
Log::info(sprintf(
Log::channel('scheduled-tasks')->info(sprintf(
' - %s: %s (%s) [%s]',
$task['name'],
$task['description'],
@@ -34,7 +34,7 @@ class ScheduledTaskRefreshCommand extends Command
return Command::SUCCESS;
} catch (\Exception $e) {
Log::error("刷新失败: {$e->getMessage()}");
Log::channel('scheduled-tasks')->error("刷新失败: {$e->getMessage()}");
return Command::FAILURE;
}
}