Skip to content

feat: replace console.log statements with Winston logger across all s…#31

Open
Adithyakp86 wants to merge 1 commit intoatithi4dev:mainfrom
Adithyakp86:main
Open

feat: replace console.log statements with Winston logger across all s…#31
Adithyakp86 wants to merge 1 commit intoatithi4dev:mainfrom
Adithyakp86:main

Conversation

@Adithyakp86
Copy link

…ervices

Issue===#29

Summary

This PR addresses the issue of inconsistent logging by replacing all console.log and console.error statements with proper Winston logger usage across the entire application.

Changes Made

🔧 API Gateway Service

  • auth.controller.ts: 2 → Replaced console.error with logger.error()
  • repo.controller.ts: 2 → Replaced console.error with logger.error()
  • env.controller.ts: 1 → Replaced console.error with logger.error()
  • projects.controller.ts: 3 → Replaced console.log with appropriate logger methods
  • postgresDb.ts: 1 → Replaced console.error with logger.error()
  • consumer.ts: 5 → Replaced various console statements with logger methods
  • build-queue.ts: 1 → Replaced console.log with logger.info()
  • clone-queue.ts: 1 → Replaced console.log with logger.info()
  • auth.middlewares.ts: 3 → Replaced console.log with logger.debug()
  • index.ts: 2 → Replaced console statements with logger methods
  • router.controller.ts: 1 → Replaced console.log with logger.info()
  • healthCheck.controller.ts: 1 → Replaced console.log with logger.info()

📧 Notification Service

  • logs.controller.ts: 5 → Replaced console statements with logger methods

🏗️ Workers

  • clone-worker/PathCheck.ts: 1 → Replaced console.error with logger.error()
  • clone-worker/detectProjectType.ts: 1 → Replaced console.warn with logger.warn()

🔄 Routing Service

  • app.ts: 4 → Replaced console.log statements with logger methods

⚙️ Orchestrate Service

  • container.controller.ts: 1 → Replaced console.log with logger.info()

📊 Total Impact

  • 25+ console statements replaced across 16 files
  • Consistent logging format using Winston logger
  • Proper log levels implemented (error, info, warn, debug)
  • Enhanced error context with structured logging
  • Security improvement by removing direct console output

Testing

  • All logger imports properly added
  • Log levels appropriately assigned
  • Error objects properly included in log context
  • No functional changes to application behavior

📋 Issue Reference

Fixes #[issue-number] - Console.log Statements Present in Production Code

🎯 Benefits

  • Consistent logging across all services
  • Better debugging capabilities with structured logs
  • Improved security by avoiding direct console output
  • Proper log level categorization for monitoring

@Adithyakp86
Copy link
Author

review this PR

@github-actions
Copy link

PR Update Needed

This PR has been waiting for 14 days. Please:

  • Address review comments if any
  • Rebase on latest test branch
  • Resolve any conflicts
  • Push updates

If this PR is no longer needed, please close it. Thank you!

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.

2 participants