-
Notifications
You must be signed in to change notification settings - Fork 1
Better logging #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better logging #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a notification level filtering system to control which notifications are sent to external services (Slack/Discord) or logged to the console. The filtering system has three levels: HIGH (critical alerts), MED (successful operations and moderate warnings), and LOW (informational messages).
Key changes include:
- Added NotificationLevel enum (HIGH, MED, LOW) with filtering logic in the sendNotification function
- Updated all sendNotification calls throughout the codebase to specify appropriate notification levels
- Added getNotificationLevelForAuction helper function to determine notification levels based on auction type and fill status
- Added configuration validation and documentation for the new notificationLevel config option
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/notifier.ts | Added NotificationLevel enum, implemented level-based filtering in sendNotification, and added getNotificationLevelForAuction helper function |
| src/utils/config.ts | Added notificationLevel field to AppConfig interface and validation logic |
| src/work_submitter.ts | Updated sendNotification calls to use appropriate notification levels; fixed spelling error "transfering" → "transferring" |
| src/work_handler.ts | Updated sendNotification call to use NotificationLevel.MED |
| src/pool_event_handler.ts | Updated multiple sendNotification calls to use getNotificationLevelForAuction for appropriate level assignment |
| src/liquidations.ts | Updated sendNotification call to use NotificationLevel.MED |
| src/bidder_submitter.ts | Updated sendNotification calls throughout to use getNotificationLevelForAuction and appropriate levels |
| src/bidder_handler.ts | Updated sendNotification call to use getNotificationLevelForAuction |
| src/utils/soroban_helper.ts | Adjusted transaction timeout from 6 seconds to 12 seconds; moved submitStartTime initialization |
| test/utils/notifier.test.ts | Added comprehensive test suite for notification filtering, webhook integration, and getNotificationLevelForAuction function |
| test/utils/config.test.ts | Added test for notification level validation |
| test/bidder_submitter.test.ts | Updated test expectations to include notification level parameter |
| example.config.json | Added example notificationLevel configuration |
| README.md | Added documentation for the new notificationLevel configuration option |
| start.sh | Removed extra blank lines |
| example.env | Removed example environment file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.