Add some additional breadcrumbs

This commit is contained in:
Marek Roszko
2025-06-07 09:01:05 -04:00
parent 3c76e042e2
commit 34be0452fd
5 changed files with 25 additions and 10 deletions
+8
View File
@@ -103,4 +103,12 @@ void APP_MONITOR::AddNavigationBreadcrumb( const wxString& aMsg, const wxString&
#ifdef KICAD_USE_SENTRY
AddBreadcrumb( BREADCRUMB_TYPE::NAVIGATION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
#endif
}
void APP_MONITOR::AddTransactionBreadcrumb( const wxString& aMsg, const wxString& aCategory )
{
#ifdef KICAD_USE_SENTRY
AddBreadcrumb( BREADCRUMB_TYPE::TRANSACTION, aMsg, aCategory, BREADCRUMB_LEVEL::INFO );
#endif
}
+7
View File
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <app_monitor.h>
#include <dialog_shim.h>
#include <core/ignore.h>
#include <kiway_player.h>
@@ -111,6 +112,9 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
#endif
Bind( wxEVT_PAINT, &DIALOG_SHIM::OnPaint, this );
wxString msg = wxString::Format( "Opening dialog %s", GetTitle() );
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.open" );
}
@@ -576,6 +580,9 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
void DIALOG_SHIM::OnCloseWindow( wxCloseEvent& aEvent )
{
wxString msg = wxString::Format( "Closing dialog %s", GetTitle() );
APP_MONITOR::AddNavigationBreadcrumb( msg, "dialog.close" );
if( IsQuasiModal() )
{
EndQuasiModal( wxID_CANCEL );
-8
View File
@@ -257,10 +257,8 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
setlocale( lc_new_type, user_locale.c_str() );
#ifdef KICAD_USE_SENTRY
msg = wxString::Format( "Loading kiface %d", aFaceId );
APP_MONITOR::AddNavigationBreadcrumb( msg, "kiway.kiface" );
#endif
if( !success )
{
@@ -417,10 +415,8 @@ KIWAY_PLAYER* KIWAY::Player( FRAME_T aFrameType, bool doCreate, wxTopLevelWindow
{
try
{
#ifdef KICAD_USE_SENTRY
wxString msg = wxString::Format( "Creating window type %d", aFrameType );
APP_MONITOR::AddNavigationBreadcrumb( msg, "kiway.player" );
#endif
FACE_T face_type = KifaceType( aFrameType );
KIFACE* kiface = KiFACE( face_type );
@@ -470,10 +466,8 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
if( frame == nullptr ) // Already closed
return true;
#ifdef KICAD_USE_SENTRY
wxString msg = wxString::Format( "Closing window type %d", aFrameType );
APP_MONITOR::AddNavigationBreadcrumb( msg, "kiway.playerclose" );
#endif
if( frame->NonUserClose( doForce ) )
{
@@ -617,9 +611,7 @@ void KIWAY::CommonSettingsChanged( int aFlags )
void KIWAY::ProjectChanged()
{
#ifdef KICAD_USE_SENTRY
APP_MONITOR::AddNavigationBreadcrumb( "Changing project", "kiway.projectchanged" );
#endif
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
{
+5 -1
View File
@@ -30,6 +30,7 @@
#include <stack>
#include <trace_helpers.h>
#include <kiplatform/ui.h>
#include <app_monitor.h>
#include <wx/event.h>
#include <wx/clipbrd.h>
@@ -462,6 +463,9 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
{
wxASSERT( aTool != nullptr );
wxString msg = wxString::Format( wxS( "TOOL_MANAGER::runTool - running tool %s" ), aTool->GetName() );
APP_MONITOR::AddTransactionBreadcrumb( msg, "tool.run" );
if( !isRegistered( aTool ) )
{
wxASSERT_MSG( false, wxT( "You cannot run unregistered tools" ) );
@@ -470,7 +474,7 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool )
TOOL_ID id = aTool->GetId();
wxLogTrace( kicadTraceToolStack, wxS( "TOOL_MANAGER::runTool - running tool %s" ),
wxLogTrace( kicadTraceToolStack, msg,
aTool->GetName() );
if( aTool->GetType() == INTERACTIVE )
+5 -1
View File
@@ -51,7 +51,11 @@ namespace APP_MONITOR
DBG
};
KICOMMON_API void AddBreadcrumb( BREADCRUMB_TYPE aType, const wxString& aMsg, const wxString& aCategory, BREADCRUMB_LEVEL aLevel );
KICOMMON_API void AddBreadcrumb( BREADCRUMB_TYPE aType, const wxString& aMsg, const wxString& aCategory,
BREADCRUMB_LEVEL aLevel = BREADCRUMB_LEVEL::INFO );
KICOMMON_API void AddNavigationBreadcrumb( const wxString& aMsg, const wxString& aCategory );
KICOMMON_API void AddTransactionBreadcrumb( const wxString& aMsg, const wxString& aCategory );
}