v4.16.4 - Bugfix: logger LWC Initialization Message
Core Unlocked Package Changes
Fixed #870 (reported by @dominykasvitkus) by updating the logger LWC initialization message to only print when JavaScript console logging is enabled via LoggerSettings__c. Also resolved some test isolation issues in logger.test.js + test improvements + code cleanup:
- Updated
loggerService.jsto only callconsole.info()with an init message ('logger component initialized') when console logging is enabled viaLoggerSettings__c.IsJavaScriptConsoleLoggingEnabled__c - Replaced
enableSystemMessages()anddisableSystemMessages()inloggerService.jswith a new static variableLoggerService.areSystemMessagesEnabled(intended for internal-use only) - Updated
logger.test.jsto resetLoggerService.hasInitializedandLoggerService.areSystemMessagesEnabledstatic variables inbeforeEach()(instead ofafterAll()) - Switched to using
jest.resetAllMocks()instead ofjest.clearAllMocks()inlogger.test.jsfor better test isolation - Updated all test functions to consistently use all 3 logger creation methods (
createLogger,getLogger, andgetMarkupLogger)
Also include a 🤏 liiiiiiitle bit of scope creep:
- Updated all Jest tests to import createElement from '@lwc/engine-dom' (instead of 'lwc')
- Updated the project's threshold for code coverage in
codecov.ymlto compensate for the lower code coverage in LWC tests for now (currently around ~86%). Eventually, tests & code coverage for LWC will be improved - but for now, the constant pipeline alerts from codecov.io aren't particularly helpful 😅 - Cleaned up a small code block in
LogBatchPurgerusing the null coalescing operator (??) to reduce the lines of code needed - Corrected the label on field
LoggerScenarioRule__mdt.IsLogAssignmentEnabled__cto use the termLogger Scenario, instead of the deprecated termLog Scenario
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.16.3...v4.16.4
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04tKe0000011MyWIAU - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011MyWIAU
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011MyWIAU