-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix/15634 inconsistent logging levels #15653
base: master
Are you sure you want to change the base?
Fix/15634 inconsistent logging levels #15653
Conversation
Hi, thanks for your contribution! |
This PR only fixes some cases of inconsistent logging. There are likely more files where similar improvements can be made, I can expand the PR further based on the feedback. |
@@ -1,3 +1,5 @@ | |||
import logger from './react/features/base/logging/logger'; |
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.
Is there such a thing?
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.
Not sure this is correct at all ... have you tested this at all?
Thie is a service worker and is run outside of the app and is deliberately using console logging. Logger depends on configuration which is not enabled and available here.
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.
thanks for the clarification! You’re absolutely right
I’ll revert the changes in pwa-worker.js
could you guide me on which files should be updated?
Would really appreciate your input before making further changes.
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.
What problem are you trying to solve?
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.
the main issue iam addressing here is inconsistent logging levels across the codebase. Right now, some errors are logged using console.log instead of console.error, which makes debugging harder. Additionally, some parts of the code use direct console statements instead of the logger utility,
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.
Well what I mean, is to fix the issues you have experienced and find problematic.
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.
The PWA worker is outside of the main jitsi meet app, so it doesn't follow the same rules. Please leave it out.
@@ -63,6 +63,7 @@ async function _startScreenSharing(dispatch: IStore['dispatch'], state: IReduxSt | |||
}, NOTIFICATION_TIMEOUT_TYPE.LONG)); | |||
} | |||
} catch (error: any) { | |||
console.log('ERROR creating screen-sharing stream ', error); | |||
console.error('ERROR creating screen-sharing stream ', error); |
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 should be using the logger indeed.
Also the ERROR is redundant since it's already implied by the log level.
Fixes #15634
fixed inconsistent logging levels in two critical areas of the codebase, service worker error handling and screen-sharing failures
Previously, these error cases used console.log, making it difficult to identify failures during debugging.