Skip to content

Replace direct console usage with logger in MongoWatcherCollection #885

@coderabbitai

Description

@coderabbitai

Description

Currently, the MongoWatcherCollection class uses direct console.warn and console.error calls for logging. As suggested in PR #880, we should replace these with a proper logger for better context and log routing when logs are written to a file.

Proposed Solution

Modify the MongoWatcherCollection class to:

  1. Accept an optional logger parameter in the constructor
  2. Default to using console if no logger is provided
  3. Replace all direct console.warn and console.error calls with the logger

This will improve log handling and make the class more flexible while maintaining compatibility with current usage.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions