Skip to content
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

Remove use of self from enableLogger #5936

Merged
merged 1 commit into from Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/logger.ts
Expand Up @@ -55,7 +55,7 @@ function exportLoggerFunctions(
export function enableLogs(debugConfig: boolean | ILogger, id: string): void {
// check that console is available
if (
(self.console && debugConfig === true) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use optionalSelf instead here like in the other places? That one shouldn’t throw

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to use console in contexts where it is global regardless of whether self is.

(typeof console === 'object' && debugConfig === true) ||
typeof debugConfig === 'object'
) {
exportLoggerFunctions(
Expand Down