Log UUID when -debug option is specified (fix #4104)

In this way, in some cases, we could ask to the user for the -debug
report and match some Sentry crash report with the user.
This commit is contained in:
David Capello 2023-11-06 19:59:20 -03:00
parent 8da8473c63
commit 853e10e483

View File

@ -121,10 +121,12 @@ void CheckUpdateThreadLauncher::launch()
if (m_uuid.empty()) if (m_uuid.empty())
m_uuid = m_preferences.updater.uuid(); m_uuid = m_preferences.updater.uuid();
if (!m_uuid.empty()) {
#if ENABLE_SENTRY #if ENABLE_SENTRY
if (!m_uuid.empty())
Sentry::setUserID(m_uuid); Sentry::setUserID(m_uuid);
#endif #endif
LOG(VERBOSE, "APP: Saved UUID %s\n", m_uuid.c_str());
}
// In this case we are in the "wait days" period, so we don't check // In this case we are in the "wait days" period, so we don't check
// for updates. // for updates.
@ -179,10 +181,12 @@ void CheckUpdateThreadLauncher::onMonitoringTick()
m_uuid = m_response.getUuid(); m_uuid = m_response.getUuid();
m_preferences.updater.uuid(m_uuid); m_preferences.updater.uuid(m_uuid);
if (!m_uuid.empty()) {
#if ENABLE_SENTRY #if ENABLE_SENTRY
if (!m_uuid.empty())
Sentry::setUserID(m_uuid); Sentry::setUserID(m_uuid);
#endif #endif
LOG(VERBOSE, "APP: New UUID %s\n", m_uuid.c_str());
}
} }
// Set the date of the last "check for updates" and the "WaitDays" parameter. // Set the date of the last "check for updates" and the "WaitDays" parameter.