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

fix(nsis): keep injected logger state #5596

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

jupp0r
Copy link
Contributor

@jupp0r jupp0r commented Jan 29, 2021

This change avoids loosing state in the logger in case users inject a logger class instead of an object with functions.

@jupp0r
Copy link
Contributor Author

jupp0r commented Jan 29, 2021

I don't think the CI failures are relevant to my changes, please advice on how to handle them.

if (debug != null) {
debug(`download range: ${range}`)
if (this.logger.debug) {
this.logger.debug(`download range: ${range}`)
Copy link
Collaborator

@mmaietta mmaietta Feb 14, 2021

Choose a reason for hiding this comment

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

Can logger be null?
Alternative approach since we're in typescript, we can use optionals to avoid the extra if check.

this.logger?.debug?.(`download range: ${range}`)

Also, if you merge in the latest master, that should resolve the CI build errors.

This change avoids loosing state in the logger in case users inject a logger class instead of an object with functions.
@mmaietta mmaietta merged commit be4a1fb into electron-userland:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants