From 042bf0444603a2471e6174baab3a3063d99effe9 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Tue, 17 Oct 2023 18:11:30 +0800 Subject: [PATCH] FIX: add import and load config log Jira: XXXX Change-Id: Id32e28cf2cf30816d14f9810feb29eaf24e83231 --- src/libslic3r/Preset.cpp | 3 ++- src/libslic3r/PresetBundle.cpp | 2 ++ src/slic3r/GUI/MainFrame.cpp | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 691a24b3a..616678fc1 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1071,7 +1071,7 @@ void PresetCollection::load_presets( } //BBS: add config related logs - BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" enter, load presets from %1%, current type %2%")%dir %Preset::get_type_string(m_type); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" enter, load presets from %1%, current type %2%")%dir %Preset::get_type_string(m_type); //BBS do not parse folder if not exists m_dir_path = dir.string(); if (!fs::exists(dir)) { @@ -1203,6 +1203,7 @@ void PresetCollection::load_presets( fs::remove(file_path); } presets_loaded.emplace_back(preset); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " load config successful and preset name is:" << preset.name; } catch (const std::runtime_error &err) { errors_cummulative += err.what(); errors_cummulative += "\n"; diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 7da16d17d..454971f5c 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -518,6 +518,7 @@ std::string PresetBundle::get_hotend_model_for_printer_model(std::string model_n PresetsConfigSubstitutions PresetBundle::load_user_presets(std::string user, ForwardCompatibilitySubstitutionRule substitution_rule) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " entry and user is: " << user; PresetsConfigSubstitutions substitutions; std::string errors_cummulative; @@ -642,6 +643,7 @@ PresetsConfigSubstitutions PresetBundle::import_presets(std::vector std::function override_confirm, ForwardCompatibilitySubstitutionRule rule) { + BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << " entry"; PresetsConfigSubstitutions substitutions; int overwrite = 0; std::vector result; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index b62dc6d27..16713a72b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -3195,6 +3195,11 @@ void MainFrame::load_config_file() if (!cfiles.empty()) { wxGetApp().app_config->update_config_dir(get_dir_name(cfiles.back())); wxGetApp().load_current_presets(); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " presets has been import,and size is" << cfiles.size(); + NetworkAgent* agent = wxGetApp().getAgent(); + if (agent) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " user is: " << agent->get_user_id(); + } } MessageDialog dlg2(this, wxString::Format(_L_PLURAL("There is %d config imported. (Only non-system and compatible configs)", "There are %d configs imported. (Only non-system and compatible configs)", cfiles.size()), cfiles.size()),