From 75b59455b604874325cd4837d98cded4036fa1bb Mon Sep 17 00:00:00 2001 From: supermerill Date: Sat, 23 Oct 2021 12:02:45 +0200 Subject: [PATCH] add logs for issue supermerill/SuperSlicer#1631 --- src/slic3r/GUI/PhysicalPrinterDialog.cpp | 9 +++++++++ src/slic3r/Utils/OctoPrint.cpp | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 280b0a045..307259f47 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -653,6 +653,7 @@ void PhysicalPrinterDialog::on_dpi_changed(const wxRect& suggested_rect) void PhysicalPrinterDialog::OnOK(wxEvent& event) { + BOOST_LOG_TRIVIAL(info) << "begin of pysical update"; wxString printer_name = m_printer_name->GetValue(); if (printer_name.IsEmpty()) { warning_catcher(this, _L("The supplied name is empty. It can't be saved.")); @@ -675,11 +676,14 @@ void PhysicalPrinterDialog::OnOK(wxEvent& event) return; m_printer.name = existing->name; + BOOST_LOG_TRIVIAL(info) << "Using existing name"; } + BOOST_LOG_TRIVIAL(info) << "Adding physical to all presets"; std::set repeat_presets; m_printer.reset_presets(); for (PresetForPrinter* preset : m_presets) { + BOOST_LOG_TRIVIAL(info) << "check repeat preset " << preset->get_preset_name() << " : " << (!m_printer.add_preset(preset->get_preset_name())); if (!m_printer.add_preset(preset->get_preset_name())) repeat_presets.emplace(preset->get_preset_name()); } @@ -698,18 +702,22 @@ void PhysicalPrinterDialog::OnOK(wxEvent& event) return; } + BOOST_LOG_TRIVIAL(info) << "check rename"; std::string renamed_from; // temporary save previous printer name if it was edited if (m_printer.name != into_u8(m_default_name) && m_printer.name != into_u8(printer_name)) renamed_from = m_printer.name; + BOOST_LOG_TRIVIAL(info) << "update printer name, if it was changed, to "<< printer_name; //update printer name, if it was changed m_printer.set_name(into_u8(printer_name)); + BOOST_LOG_TRIVIAL(info) << "save new physical printer"; // save new physical printer printers.save_printer(m_printer, renamed_from); + BOOST_LOG_TRIVIAL(info) << "refresh preset list on Printer Settings Tab"; if (m_printer.preset_names.find(printers.get_selected_printer_preset_name()) == m_printer.preset_names.end()) { // select first preset for this printer printers.select_printer(m_printer); @@ -719,6 +727,7 @@ void PhysicalPrinterDialog::OnOK(wxEvent& event) else wxGetApp().get_tab(Preset::TYPE_PRINTER)->update_preset_choice(); + BOOST_LOG_TRIVIAL(info) << "end of pysical update"; event.Skip(); } diff --git a/src/slic3r/Utils/OctoPrint.cpp b/src/slic3r/Utils/OctoPrint.cpp index f0d9982e4..e125dc19a 100644 --- a/src/slic3r/Utils/OctoPrint.cpp +++ b/src/slic3r/Utils/OctoPrint.cpp @@ -44,37 +44,47 @@ bool OctoPrint::test(wxString &msg) const auto http = Http::get(std::move(url)); set_auth(http); + BOOST_LOG_TRIVIAL(info) << "auth set"; http.on_error([&](std::string body, std::string error, unsigned status) { + BOOST_LOG_TRIVIAL(info) << "Error with '"<< body<<"'"; BOOST_LOG_TRIVIAL(error) << boost::format("%1%: Error getting version: %2%, HTTP %3%, body: `%4%`") % name % error % status % body; res = false; msg = format_error(body, error, status); }) .on_complete([&, this](std::string body, unsigned) { - BOOST_LOG_TRIVIAL(debug) << boost::format("%1%: Got version: %2%") % name % body; + BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Got version: %2%") % name % body; try { std::stringstream ss(body); pt::ptree ptree; + BOOST_LOG_TRIVIAL(info) << "ready to read json"; pt::read_json(ss, ptree); + BOOST_LOG_TRIVIAL(info) << "json read"; if (! ptree.get_optional("api")) { + BOOST_LOG_TRIVIAL(info) << "Error: no api"; res = false; return; } + BOOST_LOG_TRIVIAL(info) << "text?"; const auto text = ptree.get_optional("text"); + BOOST_LOG_TRIVIAL(info) << "text="<