Skip to content

refactor(logging): replace console calls with injected Nest Logger - #1083

Open
rabsqueen wants to merge 1 commit into
rinafcode:mainfrom
rabsqueen:refactor/replace-console-calls-nest-logger-1042
Open

refactor(logging): replace console calls with injected Nest Logger#1083
rabsqueen wants to merge 1 commit into
rinafcode:mainfrom
rabsqueen:refactor/replace-console-calls-nest-logger-1042

Conversation

@rabsqueen

Copy link
Copy Markdown

🎯 Overview

Resolves #1042

Replaces unindexed console.* outputs with NestJS's structured Logger:

  • Connects log statements to correlation IDs, service tags, and indexed context fields.
  • Replaced direct console calls in automation.service.ts, achievements.seed.ts, and slack.service.ts.
  • Configured the ESLint no-console rule to prevent unindexed console logging from breaking production log aggregation pipelines.

🛠️ Key Architectural Changes

1. Logger Integration

  • Replaced console.warn in automation.service.ts with structured this.logger.warn including workflowId and actionType.
  • Introduced contextual Logger('AchievementsSeed') in achievements.seed.ts.
  • Replaced commented-out console lines in slack.service.ts with active this.logger.error handling.

2. ESLint Configuration (.eslintrc.js)

  • Enforced 'no-console': 'error' for all files in src/**.
  • Configured narrow overrides allowing console output for explicit CLI and migration seed scripts.

🧪 Testing & Verification

npm run lint:ci
npm run test

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@rabsqueen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job done so far!
Kindly fix workflow to pass.

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.

Replace remaining console.* calls with the injected Nest Logger

2 participants