From fc710ff3cfb12fd30a42144836588231c51c38ed Mon Sep 17 00:00:00 2001 From: Shubham Kumar Date: Sun, 1 Feb 2026 03:41:40 +0530 Subject: [PATCH] WEB-645 fix: replace console.log with Logger service (#3066) --- .../collection-sheet/collection-sheet.component.ts | 4 +++- src/main.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/collections/collection-sheet/collection-sheet.component.ts b/src/app/collections/collection-sheet/collection-sheet.component.ts index 0ad51319a..f07137bfe 100644 --- a/src/app/collections/collection-sheet/collection-sheet.component.ts +++ b/src/app/collections/collection-sheet/collection-sheet.component.ts @@ -19,6 +19,7 @@ import { CentersService } from 'app/centers/centers.service'; import { GroupsService } from 'app/groups/groups.service'; import { Dates } from 'app/core/utils/dates'; import { CollectionSheetData, JLGGroupData, MeetingFallCenter } from '../models/collection-sheet-data.model'; +import { Logger } from 'app/core/logger/logger.service'; @Component({ selector: 'mifosx-collection-sheet', @@ -30,6 +31,7 @@ import { CollectionSheetData, JLGGroupData, MeetingFallCenter } from '../models/ ] }) export class CollectionSheetComponent implements OnInit { + private readonly log = new Logger('CollectionSheetComponent'); private formBuilder = inject(UntypedFormBuilder); private centerService = inject(CentersService); private collectionsService = inject(CollectionsService); @@ -140,7 +142,7 @@ export class CollectionSheetComponent implements OnInit { this.collectionsService .generateCollectionSheetData(this.meetingFallCenters[0].id, payload) .subscribe((jlgGroupData: JLGGroupData) => { - console.log(jlgGroupData); + this.log.debug('JLG Group Data:', jlgGroupData); }); } }); diff --git a/src/main.ts b/src/main.ts index 7763524b2..8d81b037b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,11 +17,15 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { Logger } from './app/core/logger/logger.service'; + +const log = new Logger('Bootstrap'); if (environment.production) { enableProdMode(); + Logger.enableProductionMode(); } platformBrowserDynamic() .bootstrapModule(AppModule) - .catch((err) => console.log(err)); + .catch((err) => log.error('Application bootstrap failed:', err));