-
Notifications
You must be signed in to change notification settings - Fork 28
Gates console.warn statements behind debug flag in Duck Player Native #1861
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for content-scope-scripts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 gates console.warn statements behind a debug flag in the Duck Player Native feature to prevent unnecessary warning messages from appearing in the console for users on browsers that don't support the feature.
- Wraps existing console.warn statements with debug flag checks
- Changes one console.warn to use logger.warn for consistency
- Prevents console spam for users on unsupported browsers when Duck Player is enabled
@@ -103,7 +103,7 @@ export class DuckPlayerNativeFeature extends ContentFeature { | |||
break; | |||
case 'UNKNOWN': | |||
default: | |||
console.warn('No known pageType'); | |||
logger.warn('No known pageType'); |
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.
This line uses logger.warn
while the other warning statements in this PR use console.warn
with debug checks. For consistency, this should either be if (this.isDebug) console.warn('No known pageType');
or all warning statements should use the logger approach with appropriate debug level configuration.
logger.warn('No known pageType'); | |
if (this.isDebug) console.warn('No known pageType'); |
Copilot uses AI. Check for mistakes.
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.
@mgurgel following this advise, is there a reason not to switch to the logger you have? (assuming that is gated)
ae56308
to
053bd84
Compare
Temporary Branch UpdateThe temporary branch has been updated with the latest changes. Below are the details:
Please use the above install command to update to the latest version. |
[Beta] Generated file diffTime updated: Fri, 01 Aug 2025 14:03:34 GMT Apple
File has changed Integration
File has changed |
053bd84
to
e06d42c
Compare
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1203249713006009/task/1210889176929371?focus=true
Description
Duck Player Native was sending console.warn messages when not in debug mode.
Testing Steps
Failed to get initial setup
Checklist
Please tick all that apply: