log tweak:
1. deprecate severity_level, use log_severity_level config key 2. remove encrytped bbl debug_network log file
This commit is contained in:
parent
53e45310f3
commit
8d34e22d7f
5 changed files with 30 additions and 7 deletions
|
@ -224,8 +224,8 @@ void AppConfig::set_defaults()
|
|||
if (get("enable_ssl_for_ftp").empty())
|
||||
set_bool("enable_ssl_for_ftp", true);
|
||||
|
||||
if (get("severity_level").empty())
|
||||
set("severity_level", "2");
|
||||
if (get("log_severity_level").empty())
|
||||
set("log_severity_level", "warning");
|
||||
|
||||
if (get("internal_developer_mode").empty())
|
||||
set_bool("internal_developer_mode", false);
|
||||
|
@ -384,6 +384,7 @@ void AppConfig::set_defaults()
|
|||
erase("app", "object_settings_maximized");
|
||||
erase("app", "object_settings_pos");
|
||||
erase("app", "object_settings_size");
|
||||
erase("app", "severity_level");
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
|
|
|
@ -2169,7 +2169,7 @@ void GUI_App::init_app_config()
|
|||
}
|
||||
#endif // _WIN32
|
||||
}
|
||||
set_logging_level(Slic3r::level_string_to_boost(app_config->get("severity_level")));
|
||||
set_logging_level(Slic3r::level_string_to_boost(app_config->get("log_severity_level")));
|
||||
|
||||
}
|
||||
|
||||
|
@ -2297,6 +2297,28 @@ int GUI_App::OnExit()
|
|||
m_agent = nullptr;
|
||||
}
|
||||
|
||||
// Orca: clean up encrypted bbl network log file if plugin is used
|
||||
// No point to keep them as they are encrypted and can't be used for debugging
|
||||
try {
|
||||
auto log_folder = boost::filesystem::path(data_dir()) / "log";
|
||||
const std::string filePattern = R"(debug_network_.*\.log\.enc)";
|
||||
std::regex pattern(filePattern);
|
||||
if (boost::filesystem::exists(log_folder)) {
|
||||
std::vector<boost::filesystem::path> network_logs;
|
||||
for (auto& it : boost::filesystem::directory_iterator(log_folder)) {
|
||||
auto temp_path = it.path();
|
||||
if (boost::filesystem::is_regular_file(temp_path) && std::regex_match(temp_path.filename().string(), pattern)) {
|
||||
network_logs.push_back(temp_path.filename());
|
||||
}
|
||||
}
|
||||
for (auto f : network_logs) {
|
||||
boost::filesystem::remove(f);
|
||||
}
|
||||
}
|
||||
} catch (...) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Failed to clean up encrypt bbl network log file";
|
||||
}
|
||||
|
||||
return wxApp::OnExit();
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||
set_max_recent_count((int)max_recent_count);
|
||||
|
||||
//reset log level
|
||||
auto loglevel = wxGetApp().app_config->get("severity_level");
|
||||
auto loglevel = wxGetApp().app_config->get("log_severity_level");
|
||||
Slic3r::set_logging_level(Slic3r::level_string_to_boost(loglevel));
|
||||
|
||||
// BBS
|
||||
|
|
|
@ -351,7 +351,7 @@ wxBoxSizer *PreferencesDialog::create_item_loglevel_combobox(wxString title, wxW
|
|||
std::vector<wxString>::iterator iter;
|
||||
for (iter = vlist.begin(); iter != vlist.end(); iter++) { combobox->Append(*iter); }
|
||||
|
||||
auto severity_level = app_config->get("severity_level");
|
||||
auto severity_level = app_config->get("log_severity_level");
|
||||
if (!severity_level.empty()) { combobox->SetValue(severity_level); }
|
||||
|
||||
m_sizer_combox->Add(combobox, 0, wxALIGN_CENTER, 0);
|
||||
|
@ -360,7 +360,7 @@ wxBoxSizer *PreferencesDialog::create_item_loglevel_combobox(wxString title, wxW
|
|||
combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &e) {
|
||||
auto level = Slic3r::get_string_logging_level(e.GetSelection());
|
||||
Slic3r::set_logging_level(Slic3r::level_string_to_boost(level));
|
||||
app_config->set("severity_level",level);
|
||||
app_config->set("log_severity_level",level);
|
||||
e.Skip();
|
||||
});
|
||||
return m_sizer_combox;
|
||||
|
|
|
@ -677,7 +677,7 @@ void PresetUpdater::priv::sync_config()
|
|||
}
|
||||
} catch (...) {}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error);
|
||||
BOOST_LOG_TRIVIAL(info) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error);
|
||||
})
|
||||
.timeout_connect(5)
|
||||
.on_complete([this, asset_name, cache_profile_path, cache_profile_update_file](std::string body, unsigned http_status) {
|
||||
|
|
Loading…
Reference in a new issue