-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ export class DuckPlayerNativeFeature extends ContentFeature { | |
|
||
const selectors = this.getFeatureSetting('selectors'); | ||
if (!selectors) { | ||
console.warn('No selectors found. Check remote config. Feature will not be initialized.'); | ||
if (this.isDebug) console.warn('No selectors found. Check remote config. Feature will not be initialized.'); | ||
return; | ||
} | ||
|
||
|
@@ -64,7 +64,7 @@ export class DuckPlayerNativeFeature extends ContentFeature { | |
try { | ||
initialSetup = await messages.initialSetup(); | ||
} catch (e) { | ||
console.warn('Failed to get initial setup', e); | ||
if (this.isDebug) console.warn('Failed to get initial setup', e); | ||
return; | ||
} | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Inconsistent Debug Gating for WarningsInconsistent gating of Locations (1) |
||
} | ||
|
||
if (this.currentPage) { | ||
|
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 useconsole.warn
with debug checks. For consistency, this should either beif (this.isDebug) console.warn('No known pageType');
or all warning statements should use the logger approach with appropriate debug level configuration.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)