From a12330f4e7fb1cda708ce58980a3f3e74282b553 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Fri, 15 Aug 2025 16:06:17 +0800 Subject: [PATCH] ENH: add some log for traverse jira: [STUDIO-13728] Change-Id: Ie4419ecd809bd4392035ad063849f271e687b0f0 (cherry picked from commit 7aa1916fe8491ca1653acc55ee3ac527415b6113) --- src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp | 37 ++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp b/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp index f28b64a514..b3a3a95424 100644 --- a/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp +++ b/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp @@ -110,8 +110,12 @@ std::string DevPrinterConfigUtil::get_fan_text(const std::string& type_str, cons std::map> DevPrinterConfigUtil::get_all_subseries(std::string type_str) { - std::map> subseries; std::vector m_files; + std::map> subseries; + +#if !BBL_RELEASE_TO_PUBLIC + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": path= " << m_resource_file_path + "/printers/"; +#endif wxDir dir(m_resource_file_path + "/printers/"); if (!dir.IsOpened()) { return subseries; } @@ -137,7 +141,6 @@ std::map> DevPrinterConfigUtil::get_all_su json_file >> jj; if (jj.contains("00.00.00.00")) { - json const& printer = jj["00.00.00.00"]; if (printer.contains("subseries")) { @@ -153,12 +156,36 @@ std::map> DevPrinterConfigUtil::get_all_su } subseries.insert(make_pair(model_id, subs)); } - - } } } - catch (...) {} + catch (...) + { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to load " << file; + } + } + +#if !BBL_RELEASE_TO_PUBLIC + wxString result_str; + for (auto item : subseries) + { + wxString item_str = item.first; + item_str += ": "; + for (auto to_item : item.second) + { + item_str += to_item; + item_str += " "; + } + + result_str += item_str + ", "; + } + + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": result= " << result_str; +#endif + + if (subseries.empty()) + { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": result= " << "empty"; } return subseries;