-
Notifications
You must be signed in to change notification settings - Fork 55
feat: Migrate Logger to Typescript #1120
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: development
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| const { verbose } = this.mpInstance.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.
When the Logger was migrated to TypeScript, destructuring Logger methods lost the this context. When methods like verbose() were called, this.logger inside the Logger class was undefined.
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.
NIT: Can you destructure logger so the below lines are just Logger.verbose()?
…e in batchUploader and identityApiClient
|



Background
As part of the ongoing effort to migrate the mParticle Web SDK codebase to TypeScript, the logger.js module needed to be converted to TypeScript to improve type safety, code maintainability, and developer experience. The logger is a core component used throughout the SDK for handling different log levels (none, error, warning, verbose) and custom logger implementations.
What Has Changed
Screenshots/Video
Checklist
Additional Notes
Reference Issue (For employees only. Ignore if you are an outside contributor)