Skip to content

Refactor: Remove console.log pollution and implement environment-aware LoggerService#81

Open
Anurag-elitx wants to merge 1 commit into
PSMRI:mainfrom
Anurag-elitx:refactor/environment-aware-logging
Open

Refactor: Remove console.log pollution and implement environment-aware LoggerService#81
Anurag-elitx wants to merge 1 commit into
PSMRI:mainfrom
Anurag-elitx:refactor/environment-aware-logging

Conversation

@Anurag-elitx

Copy link
Copy Markdown

Description

Replaced hardcoded console.log statements across the application's most heavily used components and services with an environment-aware LoggerService. This prevents sensitive PII data and debugging noise from leaking into the production environment console, while maintaining visibility for local development.

Related to PSMRI/AMRIT#129

Changes Made

  • Created LoggerService that checks environment.production flag.
  • Registered LoggerService in AppModule.
  • Injected LoggerService and replaced console.log with this.logger.debug in:
    • surveyor-calltype-reports.component.ts
    • beneficiary-registration-104.component.ts
    • case-sheet.component.ts
    • caseSheet.service.ts
    • search.service.ts

Migration Strategy

This is part 1 of a systematic cleanup of debugging output. Moving to a unified LoggerService helps prepare the application for Angular 19 migration where strict mode and production optimizations will be enforced.

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Anurag-elitx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 39 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8fa50abf-f26b-440c-b47c-db6d8eae5d3b

📥 Commits

Reviewing files that changed from the base of the PR and between df5db19 and 5e5baf5.

📒 Files selected for processing (7)
  • src/app/app.module.ts
  • src/app/beneficiary-registration-104/beneficiary-registration-104.component.ts
  • src/app/case-sheet/case-sheet.component.ts
  • src/app/services/caseSheetService/caseSheet.service.ts
  • src/app/services/loggerService/logger.service.ts
  • src/app/services/searchBeneficiaryService/search.service.ts
  • src/app/surveyor-calltype-reports/surveyor-calltype-reports.component.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant