KiCad PCB EDA Suite
|
This is a singleton class intended to manage sentry. More...
#include <app_monitor.h>
Public Member Functions | |
SENTRY (const SENTRY &obj)=delete | |
void | Init () |
void | Cleanup () |
bool | IsOptedIn () |
void | AddTag (const wxString &aKey, const wxString &aValue) |
void | SetSentryOptIn (bool aOptIn) |
const wxString & | GetSentryId () |
void | ResetSentryId () |
void | LogAssert (const ASSERT_CACHE_KEY &aKey, const wxString &aMsg) |
void | LogException (const wxString &aMsg) |
Static Public Member Functions | |
static SENTRY * | Instance () |
Private Member Functions | |
SENTRY () | |
bool | isConfiguredOptedIn () |
void | sentryInit () |
wxString | sentryCreateUid () |
void | readOrCreateUid () |
Private Attributes | |
bool | m_isOptedIn |
wxFileName | m_sentry_optin_fn |
wxFileName | m_sentry_uid_fn |
wxString | m_sentryUid |
std::set< ASSERT_CACHE_KEY > | m_assertCache |
Static Private Attributes | |
static SENTRY * | m_instance = nullptr |
This is a singleton class intended to manage sentry.
The inards of the api in this class are meant to be compiled out when KICAD_USE_SENTRY is not defined and become "inert" in order to reduce the need to sprinkle #ifdef checks everywhere.
Definition at line 107 of file app_monitor.h.
|
delete |
|
private |
Definition at line 43 of file app_monitor.cpp.
void SENTRY::AddTag | ( | const wxString & | aKey, |
const wxString & | aValue | ||
) |
Definition at line 65 of file app_monitor.cpp.
Referenced by PGM_BASE::InitPgm().
void SENTRY::Cleanup | ( | ) |
Definition at line 57 of file app_monitor.cpp.
Referenced by PGM_BASE::Destroy().
const wxString & SENTRY::GetSentryId | ( | ) |
Definition at line 126 of file app_monitor.cpp.
References m_sentryUid.
void SENTRY::Init | ( | ) |
Definition at line 49 of file app_monitor.cpp.
References sentryInit().
Referenced by PGM_BASE::InitPgm().
|
inlinestatic |
Definition at line 112 of file app_monitor.h.
Referenced by APP_MONITOR::AddBreadcrumb(), PANEL_DATA_COLLECTION::applySettingsToPanel(), PGM_BASE::Destroy(), PGM_BASE::HandleAssert(), PGM_BASE::HandleException(), PGM_BASE::InitPgm(), LogAssert(), LogException(), PANEL_DATA_COLLECTION::OnResetIdClick(), APP_MONITOR::TRANSACTION::TRANSACTION(), PANEL_DATA_COLLECTION::TransferDataFromWindow(), and PANEL_DATA_COLLECTION::TransferDataToWindow().
|
private |
Definition at line 196 of file app_monitor.cpp.
References KIPLATFORM::POLICY::ENABLED, KIPLATFORM::POLICY::GetPolicyBool(), m_sentry_optin_fn, KIPLATFORM::POLICY::NOT_CONFIGURED, and POLICY_KEY_DATACOLLECTION.
Referenced by sentryInit().
bool SENTRY::IsOptedIn | ( | ) |
Definition at line 209 of file app_monitor.cpp.
References KIPLATFORM::POLICY::ENABLED, KIPLATFORM::POLICY::GetPolicyBool(), m_isOptedIn, KIPLATFORM::POLICY::NOT_CONFIGURED, and POLICY_KEY_DATACOLLECTION.
Referenced by LogAssert(), and LogException().
void SENTRY::LogAssert | ( | const ASSERT_CACHE_KEY & | aKey, |
const wxString & | aMsg | ||
) |
Definition at line 226 of file app_monitor.cpp.
References Instance(), IsOptedIn(), and m_assertCache.
Referenced by PGM_BASE::HandleAssert().
void SENTRY::LogException | ( | const wxString & | aMsg | ) |
Definition at line 250 of file app_monitor.cpp.
References Instance(), and IsOptedIn().
Referenced by PGM_BASE::HandleException().
|
private |
Definition at line 132 of file app_monitor.cpp.
References m_sentry_uid_fn, m_sentryUid, and ResetSentryId().
Referenced by sentryInit(), and SetSentryOptIn().
void SENTRY::ResetSentryId | ( | ) |
Definition at line 120 of file app_monitor.cpp.
References m_sentryUid, and sentryCreateUid().
Referenced by PANEL_DATA_COLLECTION::OnResetIdClick(), and readOrCreateUid().
|
private |
Definition at line 107 of file app_monitor.cpp.
References m_sentry_uid_fn.
Referenced by ResetSentryId().
|
private |
Definition at line 145 of file app_monitor.cpp.
References GetBuildVersion(), GetCommitHash(), GetMajorMinorVersion(), PATHS::GetUserCachePath(), isConfiguredOptedIn(), m_isOptedIn, m_sentry_optin_fn, m_sentry_uid_fn, m_sentryUid, and readOrCreateUid().
Referenced by Init().
void SENTRY::SetSentryOptIn | ( | bool | aOptIn | ) |
Definition at line 73 of file app_monitor.cpp.
References m_isOptedIn, m_sentry_optin_fn, and readOrCreateUid().
Referenced by PANEL_DATA_COLLECTION::TransferDataFromWindow().
|
private |
Definition at line 147 of file app_monitor.h.
Referenced by LogAssert().
|
staticprivate |
Definition at line 140 of file app_monitor.h.
|
private |
Definition at line 142 of file app_monitor.h.
Referenced by IsOptedIn(), sentryInit(), and SetSentryOptIn().
|
private |
Definition at line 143 of file app_monitor.h.
Referenced by isConfiguredOptedIn(), sentryInit(), and SetSentryOptIn().
|
private |
Definition at line 144 of file app_monitor.h.
Referenced by readOrCreateUid(), sentryCreateUid(), and sentryInit().
|
private |
Definition at line 145 of file app_monitor.h.
Referenced by GetSentryId(), readOrCreateUid(), ResetSentryId(), and sentryInit().