@@ -59,6 +59,7 @@ import { CoreCourseModuleNavigationComponent } from '@features/course/components
5959import { CoreCourseModuleInfoComponent } from '@features/course/components/module-info/module-info' ;
6060import { CoreSharedModule } from '@/core/shared.module' ;
6161import { CoreH5PIframeComponent } from '@features/h5p/components/h5p-iframe/h5p-iframe' ;
62+ import { CoreLogger } from '@static/logger' ;
6263
6364/**
6465 * Component that displays an H5P activity entry page.
@@ -114,6 +115,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
114115 protected messageListenerFunction : ( event : MessageEvent ) => Promise < void > ;
115116 protected checkCompletionAfterLog = false ; // It's called later, when the user plays the package.
116117 protected offlineErrorAlert : HTMLIonAlertElement | null = null ;
118+ protected activityLogger : CoreLogger ;
117119
118120 constructor ( ) {
119121 super ( ) ;
@@ -151,6 +153,8 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
151153 ) ;
152154 }
153155 } ) ;
156+
157+ this . activityLogger = CoreLogger . getInstance ( 'AddonModH5PActivityIndex' ) ;
154158 }
155159
156160 /**
@@ -679,7 +683,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
679683 }
680684 }
681685 } catch ( error ) {
682- CoreAlerts . showError ( error , { default : 'Error sending tracking data.' } ) ;
686+ this . activityLogger . error ( 'Error posting statements for activity: ' , error ) ;
683687 }
684688 }
685689
@@ -739,7 +743,7 @@ export class AddonModH5PActivityIndexComponent extends CoreCourseModuleMainActiv
739743
740744 this . hasOffline = ! sent ;
741745 } catch ( error ) {
742- CoreAlerts . showError ( error , { default : 'Error sending tracking data.' } ) ;
746+ this . activityLogger . error ( 'Error posting state for activity: ' , error ) ;
743747 }
744748 }
745749
0 commit comments