From 7422274c0888121ab9022c938372c208414fb5a9 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 23 Sep 2024 00:21:53 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E7=9B=B8=E5=85=B3=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/MaaFramework/Task/Context.cpp | 5 +++-- source/MaaFramework/Task/PipelineTask.cpp | 6 +++--- source/MaaFramework/Task/TaskBase.cpp | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/MaaFramework/Task/Context.cpp b/source/MaaFramework/Task/Context.cpp index cd3300c23..8836db537 100644 --- a/source/MaaFramework/Task/Context.cpp +++ b/source/MaaFramework/Task/Context.cpp @@ -115,7 +115,7 @@ bool Context::override_next(const std::string& name, const std::vector Context::get_pipeline_data(const std::strin { auto override_it = pipeline_override_.find(task_name); if (override_it != pipeline_override_.end()) { + LogTrace << "found in override" << VAR(task_name); return override_it->second; } @@ -170,7 +171,7 @@ std::optional Context::get_pipeline_data(const std::strin return raw_it->second; } - LogError << "task not found" << VAR(task_name); + LogWarn << "task not found" << VAR(task_name); return std::nullopt; } diff --git a/source/MaaFramework/Task/PipelineTask.cpp b/source/MaaFramework/Task/PipelineTask.cpp index 44a6bab9f..82094964b 100644 --- a/source/MaaFramework/Task/PipelineTask.cpp +++ b/source/MaaFramework/Task/PipelineTask.cpp @@ -26,7 +26,7 @@ bool PipelineTask::run() // there is no pretask for the entry, so we use the entry itself auto begin_opt = context_->get_pipeline_data(entry_); if (!begin_opt) { - LogError << "get_pipeline_data failed" << VAR(entry_); + LogError << "get_pipeline_data failed, task not exist" << VAR(entry_); return false; } @@ -58,7 +58,7 @@ bool PipelineTask::run() bool is_interrupt = static_cast(pos) >= next_size; auto hit_opt = context_->get_pipeline_data(node_detail.name); if (!hit_opt) { - LogError << "get_pipeline_data failed" << VAR(node_detail.name); + LogError << "get_pipeline_data failed, task not exist" << VAR(node_detail.name); return false; } PipelineData hit_task = std::move(*hit_opt); @@ -91,7 +91,7 @@ bool PipelineTask::run() auto top_opt = context_->get_pipeline_data(top); if (!top_opt) { - LogError << "get_pipeline_data failed" << VAR(top); + LogError << "get_pipeline_data failed, task not exist" << VAR(top); return false; } current = std::move(*top_opt); diff --git a/source/MaaFramework/Task/TaskBase.cpp b/source/MaaFramework/Task/TaskBase.cpp index 5ec0f2f07..863dc2b0f 100644 --- a/source/MaaFramework/Task/TaskBase.cpp +++ b/source/MaaFramework/Task/TaskBase.cpp @@ -75,7 +75,7 @@ RecoResult TaskBase::run_recognition(const cv::Mat& image, const PipelineData::N auto cur_opt = context_->get_pipeline_data(cur_task_); if (!cur_opt) { - LogError << "get_pipeline_data failed" << VAR(cur_task_); + LogError << "get_pipeline_data failed, task not exist" << VAR(cur_task_); return {}; } bool current_focus = cur_opt->focus; @@ -94,7 +94,7 @@ RecoResult TaskBase::run_recognition(const cv::Mat& image, const PipelineData::N for (const auto& name : list) { auto data_opt = context_->get_pipeline_data(name); if (!data_opt) { - LogError << "get_pipeline_data failed" << VAR(name); + LogError << "get_pipeline_data failed, task not exist" << VAR(name); continue; } const auto& pipeline_data = *data_opt; @@ -158,7 +158,7 @@ NodeDetail TaskBase::run_action(const RecoResult& reco) auto cur_opt = context_->get_pipeline_data(reco.name); if (!cur_opt) { - LogError << "get_pipeline_data failed" << VAR(reco.name); + LogError << "get_pipeline_data failed, task not exist" << VAR(reco.name); return {}; } const auto& pipeline_data = *cur_opt;