Skip to content

Logger: wrap message in @autoclosure to avoid creating when LogLevel is disabled#1781

Merged
NachoSoto merged 1 commit into
mainfrom
logger-autoclosure
Jul 29, 2022
Merged

Logger: wrap message in @autoclosure to avoid creating when LogLevel is disabled#1781
NachoSoto merged 1 commit into
mainfrom
logger-autoclosure

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

I realized in #1780 that we might be doing unnecessary work creating messages that are never logged. This is a small optimization to prevent that.

…gLevel` is disabled

I realized in #1780 that we might be doing unnecessary work creating messages that are never logged. This is a small optimization to prevent that.
@NachoSoto NachoSoto added the pr:fix A bug fix label Jul 28, 2022
@NachoSoto NachoSoto requested review from a team July 28, 2022 15:31

@aboedo aboedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice

@NachoSoto NachoSoto merged commit a95fb58 into main Jul 29, 2022
@NachoSoto NachoSoto deleted the logger-autoclosure branch July 29, 2022 20:19
@NachoSoto NachoSoto mentioned this pull request Jul 29, 2022
This was referenced Aug 1, 2022
NachoSoto added a commit that referenced this pull request Aug 1, 2022
### Fixes:
* `CustomerInfoResponseHandler`: return `CustomerInfo` instead of error if the response was successful (#1778) via NachoSoto (@NachoSoto)
* Error logging: `logErrorIfNeeded` no longer prints message if it's the same as the error description (#1776) via NachoSoto (@NachoSoto)
* fix another broken link in docC docs (#1777) via aboedo (@aboedo)
* fix links to restorePurchase (#1775) via aboedo (@aboedo)
* fix getProducts docs broken link (#1772) via aboedo (@aboedo)

### Improvements:
* `Logger`: wrap `message` in `@autoclosure` to avoid creating when `LogLevel` is disabled (#1781) via NachoSoto (@NachoSoto)

### Other changes:
* Lint: fixed `SubscriberAttributesManager` (#1774) via NachoSoto (@NachoSoto)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants