FIX: [STUDIO-4522] hide passwd of media url from log

Change-Id: Ib4da577ea39cca9fb34d920101a81f1708a6934e
Jira: STUDIO-4522
This commit is contained in:
chunmao.guo
2023-08-24 10:04:39 +08:00
committed by Lane.Wei
parent f183058b20
commit 52b816b657
4 changed files with 70 additions and 32 deletions

View File

@@ -410,6 +410,8 @@ void MediaFilePanel::modeChanged(wxCommandEvent& e1)
m_last_mode = mode;
}
extern wxString hide_passwd(wxString url, std::vector<std::string> const &passwords);
void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
{
boost::shared_ptr fs(wfs.lock());
@@ -446,7 +448,7 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
if (agent) {
agent->get_camera_url(m_machine,
[this, wfs, m = m_machine, v = m_dev_ver](std::string url) {
BOOST_LOG_TRIVIAL(info) << "MediaFilePanel::fetchUrl: camera_url: " << url;
BOOST_LOG_TRIVIAL(info) << "MediaFilePanel::fetchUrl: camera_url: " << hide_passwd(url, {"authkey=", "passwd="});
CallAfter([=] {
boost::shared_ptr fs(wfs.lock());
if (!fs || fs != m_image_grid->GetFileSystem()) return;