#feature: update log format
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user