Skip to content

Commit 2ab4af9

Browse files
authored
Bugfix: logger LWC Initialization Message (#884)
* Updated loggerService.js to only call console.info() with an init message of 'logger component initialized' when console logging is enabled via LoggerSettings__c.IsJavaScriptConsoleLoggingEnabled__c * Replaced enableSystemMessages() and disableSystemMessages() with new static variable LoggerService.areSystemMessagesEnabled * Switched to using jest.resetAllMocks() instead of jest.clearAllMocks() for better test isolation * Updated tests to reset LoggerService.hasInitialized and LoggerService.areSystemMessagesEnabled static variables in beforeEach() instead of afterAll() - Updated all test functions to consistently use all logger creation methods (createLogger, getLogger, getMarkupLogger) * Scope creep: Updated project's threshold for code coverage in codecov.yml to compensate for the lower code coverage in LWC tests for now. Eventually, code coverage for LWC will be increased - but for now, the constant alerts from codecov.io aren't particularly helpful ^_^ * Scope creep: Updated all Jest tests to import createElement from '@lwc/engine-dom' (instead of 'lwc') * Scope creep: cleaned up a small code block in LogBatchPurger * Scope creep: corrected the label on field LoggerScenarioRule__mdt.IsLogAssignmentEnabled__c
1 parent b34b2c0 commit 2ab4af9

File tree

21 files changed

+102
-82
lines changed

21 files changed

+102
-82
lines changed

.github/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ coverage:
33
project:
44
default:
55
target: 90%
6-
threshold: 2%
6+
threshold: 5%
77
if_ci_failed: success
88
Apex:
99
target: 90%

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
The most robust observability solution for Salesforce experts. Built 100% natively on the platform, and designed to work seamlessly with Apex, Lightning Components, Flow, OmniStudio, and integrations.
77

8-
## Unlocked Package - v4.16.3
8+
## Unlocked Package - v4.16.4
99

10-
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011Mr1IAE)
11-
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011Mr1IAE)
10+
[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011MyWIAU)
11+
[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKe0000011MyWIAU)
1212
[![View Documentation](./images/btn-view-documentation.png)](https://github.com/jongpie/NebulaLogger/wiki)
1313

14-
`sf package install --wait 20 --security-type AdminsOnly --package 04tKe0000011Mr1IAE`
14+
`sf package install --wait 20 --security-type AdminsOnly --package 04tKe0000011MyWIAU`
1515

1616
---
1717

nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogAssignmentEnabled__c.field-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<complianceGroup>PII;GDPR;CCPA</complianceGroup>
66
<fieldManageability>DeveloperControlled</fieldManageability>
77
<inlineHelpText>Controls if new Log__c records associated with the scenario (based on Log__c.TransactionScenario__c) are automatically assigned to the owner of the LoggerScenario__c record.</inlineHelpText>
8-
<label>Assign Logs To Log Scenario Owner</label>
8+
<label>Assign Logs To Logger Scenario Owner</label>
99
<required>false</required>
1010
<securityClassification>Confidential</securityClassification>
1111
<type>Picklist</type>

nebula-logger/core/main/log-management/classes/LogBatchPurger.cls

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,8 @@ global with sharing class LogBatchPurger implements Database.Batchable<SObject>,
165165
* @return The same instance of `LogBatchPurger`, useful for chaining methods
166166
*/
167167
public LogBatchPurger setChainedBatchSize(Integer chainedBatchSize) {
168-
if (chainedBatchSize != null) {
169-
this.chainedBatchSize = chainedBatchSize;
170-
} else {
171-
this.chainedBatchSize = getDefaultBatchSize();
172-
}
168+
this.chainedBatchSize = chainedBatchSize ?? LogBatchPurger.getDefaultBatchSize();
169+
173170
return this;
174171
}
175172

nebula-logger/core/main/log-management/lwc/logBatchPurge/__tests__/logBatchPurge.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// UI
2-
import { createElement } from 'lwc';
2+
import { createElement } from '@lwc/engine-dom';
33
import LightningConfirm from 'lightning/confirm';
44
import logBatchPurge from 'c/logBatchPurge';
55
import { when } from 'jest-when';

nebula-logger/core/main/log-management/lwc/logEntryEventStream/__tests__/logEntryEventStream.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement } from 'lwc';
1+
import { createElement } from '@lwc/engine-dom';
22
import LogEntryEventStream from 'c/logEntryEventStream';
33
import { jestMockPublish } from 'lightning/empApi';
44
import getSchemaForName from '@salesforce/apex/LoggerSObjectMetadata.getSchemaForName';

nebula-logger/core/main/log-management/lwc/logOrganizationLimits/__tests__/logOrganizationLimits.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement } from 'lwc';
1+
import { createElement } from '@lwc/engine-dom';
22
import LogOrganizationLimits from 'c/logOrganizationLimits';
33
import { getRecord } from 'lightning/uiRecordApi';
44

nebula-logger/core/main/log-management/lwc/logViewer/__tests__/logViewer.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement } from 'lwc';
1+
import { createElement } from '@lwc/engine-dom';
22
import LogViewer from 'c/logViewer';
33
import getLog from '@salesforce/apex/LogViewerController.getLog';
44

nebula-logger/core/main/log-management/lwc/loggerCodeViewer/__tests__/loggerCodeViewer.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement } from 'lwc';
1+
import { createElement } from '@lwc/engine-dom';
22
import LoggerCodeViewer from 'c/loggerCodeViewer';
33

44
jest.mock(

nebula-logger/core/main/log-management/lwc/loggerHomeHeader/__tests__/loggerHomeHeader.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement } from 'lwc';
1+
import { createElement } from '@lwc/engine-dom';
22
import LoggerHomeHeader from 'c/loggerHomeHeader';
33
import getEnvironmentDetails from '@salesforce/apex/LoggerHomeHeaderController.getEnvironmentDetails';
44

0 commit comments

Comments
 (0)