FIX: not hide device id in log

Change-Id: I2d3e7e590af1b1bbee94c25f057a6b193b181b24
Jira: STUDIO-6120
This commit is contained in:
chunmao.guo 2024-01-26 14:24:58 +08:00 committed by Lane.Wei
parent 1cfb6deb72
commit 1b07b01a3b
2 changed files with 13 additions and 8 deletions

View File

@ -465,13 +465,18 @@ void MediaFilePanel::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
NetworkAgent *agent = wxGetApp().getAgent();
if (agent) {
agent->get_camera_url(m_machine,
[this, wfs, m = m_machine, v = m_dev_ver](std::string url) {
[this, wfs, m = m_machine, v = agent->get_version(), dv = m_dev_ver](std::string url) {
if (boost::algorithm::starts_with(url, "bambu:///")) {
url += "&device=" + m;
url += "&version=" + v;
url += "&dev_ver=" + dv;
}
BOOST_LOG_TRIVIAL(info) << "MediaFilePanel::fetchUrl: camera_url: " << hide_id_middle_string(hide_passwd(url, {"authkey=", "passwd="}), 9, 20);
CallAfter([=] {
boost::shared_ptr fs(wfs.lock());
if (!fs || fs != m_image_grid->GetFileSystem()) return;
if (boost::algorithm::starts_with(url, "bambu:///")) {
fs->SetUrl(url + "&device=" + m + "&dev_ver=" + v);
fs->SetUrl(url);
} else {
m_image_grid->SetStatus(m_bmp_failed, _L("Connection Failed. Please check the network and try again"));
fs->SetUrl("3");

View File

@ -159,7 +159,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
return;
}
m_machine = machine;
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl switch machine: " << hide_id_middle_string(m_machine);
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl switch machine: " << m_machine;
m_disable_lan = false;
m_failed_retry = 0;
m_last_failed_codes.clear();
@ -241,7 +241,7 @@ void MediaPlayCtrl::Play()
m_url = "bambu:///rtsps___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsps";
else if (m_lan_proto == MachineObject::LVL_Rtsp)
m_url = "bambu:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsp";
m_url += "&device=" + hide_id_middle_string(m_machine);
m_url += "&device=" + m_machine;
m_url += "&version=" + agent_version;
m_url += "&dev_ver=" + m_dev_ver;
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_passwd(hide_id_middle_string(m_url, m_url.find(m_lan_ip), m_lan_ip.length()), {m_lan_passwd});
@ -275,7 +275,7 @@ void MediaPlayCtrl::Play()
if (agent) {
agent->get_camera_url(m_machine, [this, m = m_machine, v = agent_version, dv = m_dev_ver](std::string url) {
if (boost::algorithm::starts_with(url, "bambu:///")) {
url += "&device=" + into_u8(hide_id_middle_string(m));
url += "&device=" + into_u8(m);
url += "&version=" + v;
url += "&dev_ver=" + dv;
}
@ -459,9 +459,9 @@ void MediaPlayCtrl::ToggleStream()
url = "bambu:///rtsps___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsps";
else if (m_lan_proto == MachineObject::LVL_Rtsp)
url = "bambu:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsp";
url += "&device=" + into_u8(hide_id_middle_string(m_machine));
url += "&device=" + into_u8(m_machine);
url += "&dev_ver=" + m_dev_ver;
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << hide_passwd(url, {m_lan_passwd});
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << hide_passwd(hide_id_middle_string(url, url.find(m_lan_ip), m_lan_ip.length()), {m_lan_passwd});
std::string file_url = data_dir() + "/cameratools/url.txt";
boost::nowide::ofstream file(file_url);
auto url2 = encode_path(url.c_str());
@ -619,7 +619,7 @@ void MediaPlayCtrl::media_proc()
}
wxString url = m_tasks.front();
if (m_tasks.size() >= 2 && !url.IsEmpty() && url[0] != '<' && m_tasks[1] == "<stop>") {
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: busy skip url: " << hide_id_middle_string(hide_passwd(url, {"authkey=", "passwd=", m_lan_passwd}), 9, 20);
BOOST_LOG_TRIVIAL(trace) << "MediaPlayCtrl: busy skip url: " << url;
m_tasks.pop_front();
m_tasks.pop_front();
continue;