Experiment with sentry breadcrumbs to footnote kiway events to provide more crash context
(cherry picked from commit 5b5176f104
)
This commit is contained in:
parent
7aa368c2c5
commit
41447e9b44
|
@ -45,6 +45,10 @@
|
||||||
#include <wx/utils.h>
|
#include <wx/utils.h>
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
|
|
||||||
|
#ifdef KICAD_USE_SENTRY
|
||||||
|
#include <sentry.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
KIFACE* KIWAY::m_kiface[KIWAY_FACE_COUNT];
|
KIFACE* KIWAY::m_kiface[KIWAY_FACE_COUNT];
|
||||||
int KIWAY::m_kiface_version[KIWAY_FACE_COUNT];
|
int KIWAY::m_kiface_version[KIWAY_FACE_COUNT];
|
||||||
|
|
||||||
|
@ -212,8 +216,6 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
||||||
if( m_kiface[aFaceId] )
|
if( m_kiface[aFaceId] )
|
||||||
return m_kiface[aFaceId];
|
return m_kiface[aFaceId];
|
||||||
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
// DSO with KIFACE has not been loaded yet, does caller want to load it?
|
// DSO with KIFACE has not been loaded yet, does caller want to load it?
|
||||||
if( doLoad )
|
if( doLoad )
|
||||||
{
|
{
|
||||||
|
@ -236,6 +238,7 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
||||||
bool codeSignOk = KIPLATFORM::ENV::VerifyFileSignature( dname );
|
bool codeSignOk = KIPLATFORM::ENV::VerifyFileSignature( dname );
|
||||||
if( !codeSignOk )
|
if( !codeSignOk )
|
||||||
{
|
{
|
||||||
|
wxString msg;
|
||||||
msg.Printf( _( "Failed to verify kiface library '%s' signature." ), dname );
|
msg.Printf( _( "Failed to verify kiface library '%s' signature." ), dname );
|
||||||
THROW_IO_ERROR( msg );
|
THROW_IO_ERROR( msg );
|
||||||
}
|
}
|
||||||
|
@ -257,6 +260,14 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
|
||||||
|
|
||||||
setlocale( lc_new_type, user_locale.c_str() );
|
setlocale( lc_new_type, user_locale.c_str() );
|
||||||
|
|
||||||
|
#ifdef KICAD_USE_SENTRY
|
||||||
|
wxString msg = wxString::Format( "Loading kiface %d", aFaceId );
|
||||||
|
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||||
|
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.kiface" ) );
|
||||||
|
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||||
|
sentry_add_breadcrumb( crumb );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !success )
|
if( !success )
|
||||||
{
|
{
|
||||||
// Failure: error reporting UI was done via wxLogSysError().
|
// Failure: error reporting UI was done via wxLogSysError().
|
||||||
|
@ -437,6 +448,14 @@ KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate, wxTopLevelWindow
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#ifdef KICAD_USE_SENTRY
|
||||||
|
wxString msg = wxString::Format( "Creating window type %d", aFrameType );
|
||||||
|
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||||
|
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.player" ) );
|
||||||
|
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||||
|
sentry_add_breadcrumb( crumb );
|
||||||
|
#endif
|
||||||
|
|
||||||
FACE_T face_type = KifaceType( aFrameType );
|
FACE_T face_type = KifaceType( aFrameType );
|
||||||
KIFACE* kiface = KiFACE( face_type );
|
KIFACE* kiface = KiFACE( face_type );
|
||||||
|
|
||||||
|
@ -481,6 +500,14 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
|
||||||
if( frame == nullptr ) // Already closed
|
if( frame == nullptr ) // Already closed
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
#ifdef KICAD_USE_SENTRY
|
||||||
|
wxString msg = wxString::Format( "Closing window type %d", aFrameType );
|
||||||
|
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", msg.utf8_str() );
|
||||||
|
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.playerclose" ) );
|
||||||
|
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||||
|
sentry_add_breadcrumb( crumb );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( frame->NonUserClose( doForce ) )
|
if( frame->NonUserClose( doForce ) )
|
||||||
{
|
{
|
||||||
m_playerFrameId[aFrameType] = wxID_NONE;
|
m_playerFrameId[aFrameType] = wxID_NONE;
|
||||||
|
@ -613,6 +640,13 @@ void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||||
|
|
||||||
void KIWAY::ProjectChanged()
|
void KIWAY::ProjectChanged()
|
||||||
{
|
{
|
||||||
|
#ifdef KICAD_USE_SENTRY
|
||||||
|
sentry_value_t crumb = sentry_value_new_breadcrumb( "navigation", "Changing project" );
|
||||||
|
sentry_value_set_by_key( crumb, "category", sentry_value_new_string( "kiway.projectchanged" ) );
|
||||||
|
sentry_value_set_by_key( crumb, "level", sentry_value_new_string( "info" ) );
|
||||||
|
sentry_add_breadcrumb( crumb );
|
||||||
|
#endif
|
||||||
|
|
||||||
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
|
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
|
||||||
{
|
{
|
||||||
// A dynamic_cast could be better, but creates link issues
|
// A dynamic_cast could be better, but creates link issues
|
||||||
|
|
Loading…
Reference in New Issue