diff --git a/README.md b/README.md
index 0e1b4e047..619c9343e 100644
--- a/README.md
+++ b/README.md
@@ -3,12 +3,12 @@
[![Build](https://github.com/jongpie/NebulaLogger/actions/workflows/build.yml/badge.svg)](https://github.com/jongpie/NebulaLogger/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/jongpie/NebulaLogger/branch/main/graph/badge.svg?token=1DJPDRM3N4)](https://codecov.io/gh/jongpie/NebulaLogger)
-Designed for Salesforce admins, developers & architects. A robust logger for Apex, Lightning Components, Flow, Process Builder & Integrations.
+The most robust logger for Salesforce. Works with Apex, Lightning Components, Flow, Process Builder & Integrations. Designed for Salesforce admins, developers & architects.
-## Unlocked Package - v4.8.1
+## Unlocked Package - v4.8.2
-[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015luIQAQ)
-[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015luIQAQ)
+[![Install Unlocked Package in a Sandbox](./images/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lvuQAA)
+[![Install Unlocked Package in Production](./images/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lvuQAA)
[![View Documentation](./images/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/)
## Managed Package - v4.8.0
@@ -34,7 +34,14 @@ Designed for Salesforce admins, developers & architects. A robust logger for Ape
Learn more about the design and history of the project on [Joys Of Apex blog post](https://www.joysofapex.com/advanced-logging-using-nebula-logger/)
----
+## Architecture Overview
+
+Nebula Logger is built natively on Salesforce, using Apex, lightning components and various types of objects. There are no required external dependencies. To learn more about the architecture, check out the
+[architecture overview in the wiki](https://raw.githubusercontent.com/wiki/jongpie/NebulaLogger/images/nebula-logger-architecture-overview.png).
+
+
+
+
## Installing
diff --git a/docs/apex/Configuration/LoggerScenarioRule.md b/docs/apex/Configuration/LoggerScenarioRule.md
new file mode 100644
index 000000000..5d7b84bdc
--- /dev/null
+++ b/docs/apex/Configuration/LoggerScenarioRule.md
@@ -0,0 +1,47 @@
+---
+layout: default
+---
+
+## LoggerScenarioRule class
+
+Provides a centralized way to load scenario rules that override behavior within Nebula Logger
+
+---
+
+### Methods
+
+#### `getAll()` → `Map`
+
+Returns a map containing any enabled `LoggerScenarioRule_t` records with valid `StartTime__c` and `EndTime__c` values (null is considered valid)
+
+##### Return
+
+**Type**
+
+Map<String, LoggerScenarioRule_t>
+
+**Description**
+
+The current transaction's cached `Map<String, LoggerScenarioRule_t>`, where the key
+
+#### `getInstance(String scenario)` → `LoggerScenarioRule_t`
+
+Returns the `LoggerScenarioRule_t` with the matching scenario, based on the field `LoggerScenarioRule_t.Scenario__c`
+
+##### Parameters
+
+| Param | Description |
+| ---------- | ------------------------ |
+| `scenario` | The name of the scenario |
+
+##### Return
+
+**Type**
+
+LoggerScenarioRule_t
+
+**Description**
+
+The matching `LoggerScenarioRule_t` if one is found, or `null`
+
+---
diff --git a/docs/apex/Log-Management/RelatedLogEntriesController.md b/docs/apex/Log-Management/RelatedLogEntriesController.md
index bfc3e3565..11cebcc9c 100644
--- a/docs/apex/Log-Management/RelatedLogEntriesController.md
+++ b/docs/apex/Log-Management/RelatedLogEntriesController.md
@@ -128,10 +128,6 @@ Contains the plural label of the log entry sObject, fetched using a describe cal
contains the log entry results from the query.
-###### `tabIcon` → `String`
-
-contains the tab icon of the log entry, fetched using describe a call on the log entry sObject.
-
###### `totalLogEntriesCount` → `Integer`
Contains the number of records returned via the log entries query.
diff --git a/docs/apex/Logger-Engine/Logger.md b/docs/apex/Logger-Engine/Logger.md
index 1eda24588..5958a1be6 100644
--- a/docs/apex/Logger-Engine/Logger.md
+++ b/docs/apex/Logger-Engine/Logger.md
@@ -626,6 +626,16 @@ LogEntryEventBuilder
The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods
+#### `endScenario(String scenario)` → `void`
+
+End the specified scenario, if it's the currently active scenario, and rolls back to the previous scenario (if a previous scenario was specified in the current transaction)
+
+##### Parameters
+
+| Param | Description |
+| ---------- | ------------------------------- |
+| `scenario` | The name of the scenario to end |
+
#### `error(LogMessage logMessage, Database.DeleteResult deleteResult)` → `LogEntryEventBuilder`
Creates a new log entry with logging level == `LoggingLevel.ERROR`
@@ -4470,7 +4480,7 @@ Sets the default save method used when calling saveLog() - any subsequent calls
#### `setScenario(String scenario)` → `void`
-Sets the scenario name for the current transaction - this is stored in `LogEntryEvent__e.Scenario__c` and `Log__c.Scenario__c`, and can be used to filter & group logs
+Sets the current scenario, which can be used to identify modules or groupings of for the current transaction
##### Parameters
diff --git a/docs/apex/Test-Utilities/LoggerTestConfigurator.md b/docs/apex/Test-Utilities/LoggerTestConfigurator.md
index 022dc8d01..6c19b3b38 100644
--- a/docs/apex/Test-Utilities/LoggerTestConfigurator.md
+++ b/docs/apex/Test-Utilities/LoggerTestConfigurator.md
@@ -126,15 +126,15 @@ Loads the mock `LoggerSObjectHandler_t` during test execution
| ------ | ----------------------------------------------------- |
| `mock` | The mock instance of `LoggerSObjectHandler_t` to load |
-#### `setMock(LogScenarioRule_t mock)` → `void`
+#### `setMock(LoggerScenarioRule_t mock)` → `void`
-Loads the mock `LogScenarioRule_t` during test execution
+Loads the mock `LoggerScenarioRule_t` during test execution
##### Parameters
-| Param | Description |
-| ------ | ------------------------------------------------ |
-| `mock` | The mock instance of `LogScenarioRule_t` to load |
+| Param | Description |
+| ------ | --------------------------------------------------- |
+| `mock` | The mock instance of `LoggerScenarioRule_t` to load |
#### `setMock(LogStatus_t mock)` → `void`
diff --git a/docs/apex/index.md b/docs/apex/index.md
index 8befad09d..23138145a 100644
--- a/docs/apex/index.md
+++ b/docs/apex/index.md
@@ -155,3 +155,7 @@ Provides a centralized way to load parameters for SObject handlers & plugins
### [LoggerPlugin](Configuration/LoggerPlugin)
The core of the plugin framework, used to create custom Apex & Flow plugins for `LoggerSObjectHandler` and `LogBatchPurger` based on configurations stored in the custom metadata type `LoggerPlugin_t`
+
+### [LoggerScenarioRule](Configuration/LoggerScenarioRule)
+
+Provides a centralized way to load scenario rules that override behavior within Nebula Logger
diff --git a/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls b/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls
new file mode 100644
index 000000000..83abfb7dd
--- /dev/null
+++ b/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------------------------//
+// This file is part of the Nebula Logger project, released under the MIT License. //
+// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. //
+//------------------------------------------------------------------------------------------------//
+
+/**
+ * @group Configuration
+ * @description Provides a centralized way to load scenario rules that override behavior
+ * within Nebula Logger
+ */
+public without sharing class LoggerScenarioRule {
+ private static final Map SCENARIO_NAME_TO_SCENARIO_RULE = loadLogScenarioRules();
+
+ /**
+ * @description Returns a map containing any enabled `LoggerScenarioRule__mdt` records with
+ * valid `StartTime__c` and `EndTime__c` values (null is considered valid)
+ * @return The current transaction's cached `Map`, where the key
+ * is the log scenario (configured in `LoggerScenarioRule__mdt.Scenario__c`)
+ */
+ public static Map getAll() {
+ return SCENARIO_NAME_TO_SCENARIO_RULE;
+ }
+
+ /**
+ * @description Returns the `LoggerScenarioRule__mdt` with the matching scenario,
+ * based on the field `LoggerScenarioRule__mdt.Scenario__c`
+ * @param scenario The name of the scenario
+ * @return The matching `LoggerScenarioRule__mdt` if one is found, or `null`
+ */
+ public static LoggerScenarioRule__mdt getInstance(String scenario) {
+ return SCENARIO_NAME_TO_SCENARIO_RULE.get(scenario);
+ }
+
+ @TestVisible
+ private static void setMock(LoggerScenarioRule__mdt scenarioRule) {
+ if (String.isBlank(scenarioRule.Scenario__c) == true) {
+ throw new IllegalArgumentException('Scenario__c is required on `LoggerScenarioRule__mdt: \n' + JSON.serializePretty(scenarioRule));
+ }
+
+ if (isValid(scenarioRule) == true) {
+ SCENARIO_NAME_TO_SCENARIO_RULE.put(scenarioRule.Scenario__c, scenarioRule);
+ }
+ }
+
+ private static Map loadLogScenarioRules() {
+ Map scenarioRules = new Map();
+ for (LoggerScenarioRule__mdt scenarioRule : LoggerScenarioRule__mdt.getAll().values()) {
+ if (isValid(scenarioRule) == true) {
+ scenarioRules.put(scenarioRule.Scenario__c, scenarioRule);
+ }
+ }
+
+ if (System.Test.isRunningTest() == true) {
+ scenarioRules.clear();
+ }
+
+ return scenarioRules;
+ }
+
+ private static Boolean isValid(LoggerScenarioRule__mdt scenarioRule) {
+ Boolean isValid = false;
+ if (scenarioRule.IsEnabled__c == true) {
+ Datetime currentTime = System.now();
+ Boolean startTimeIsValid = scenarioRule.StartTime__c == null || scenarioRule.StartTime__c <= currentTime;
+ Boolean endTimeIsValid = scenarioRule.EndTime__c == null || scenarioRule.EndTime__c >= currentTime;
+
+ isValid = startTimeIsValid == true && endTimeIsValid == true;
+ }
+ return isValid;
+ }
+}
diff --git a/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls-meta.xml b/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls-meta.xml
new file mode 100644
index 000000000..c47403d0b
--- /dev/null
+++ b/nebula-logger/core/main/configuration/classes/LoggerScenarioRule.cls-meta.xml
@@ -0,0 +1,5 @@
+
+
+ 55.0
+ Active
+
diff --git a/nebula-logger/core/main/configuration/layouts/LoggerScenarioRule__mdt-Logger Scenario Rule Layout.layout-meta.xml b/nebula-logger/core/main/configuration/layouts/LoggerScenarioRule__mdt-Logger Scenario Rule Layout.layout-meta.xml
new file mode 100644
index 000000000..ac3f1a26f
--- /dev/null
+++ b/nebula-logger/core/main/configuration/layouts/LoggerScenarioRule__mdt-Logger Scenario Rule Layout.layout-meta.xml
@@ -0,0 +1,164 @@
+
+
+
+ false
+ true
+ true
+
+
+
+ Required
+ MasterLabel
+
+
+ Required
+ DeveloperName
+
+
+ Required
+ Scenario__c
+
+
+
+
+ Edit
+ IsEnabled__c
+
+
+ Edit
+ StartTime__c
+
+
+ Edit
+ EndTime__c
+
+
+
+
+
+ true
+ true
+ true
+
+
+
+ Edit
+ IsLoggerEnabled__c
+
+
+ Edit
+ UserLoggingLevel__c
+
+
+ Edit
+ IsSavingEnabled__c
+
+
+ Edit
+ SaveMethod__c
+
+
+
+
+ Edit
+ IsAnonymousModeEnabled__c
+
+
+ Edit
+ IsApexSystemDebugLoggingEnabled__c
+
+
+ Edit
+ IsJavaScriptConsoleLoggingEnabled__c
+
+
+ Edit
+ IsDataMaskingEnabled__c
+
+
+ Edit
+ IsRecordFieldStrippingEnabled__c
+
+
+
+
+
+ true
+ true
+ true
+
+
+
+ Edit
+ IsPlatformEventStorageLocationEnabled__c
+
+
+ Edit
+ PlatformEventStorageLocation__c
+
+
+ Edit
+ IsLogAssignmentEnabled__c
+
+
+
+
+ Edit
+ IsLogRetentionOverrideEnabled__c
+
+
+ Edit
+ NumberOfDaysToRetainLogs__c
+
+
+
+
+
+ false
+ true
+ true
+
+
+
+ Required
+ NamespacePrefix
+
+
+ Readonly
+ CreatedById
+
+
+
+
+ Edit
+ IsProtected
+
+
+ Readonly
+ LastModifiedById
+
+
+
+
+
+ true
+ true
+ false
+
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+
+ 00h63000007CAvC
+ 4
+ 0
+ Default
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/LoggerScenarioRule__mdt.object-meta.xml
similarity index 62%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml
rename to nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/LoggerScenarioRule__mdt.object-meta.xml
index 3c9a934f5..beddfb99b 100644
--- a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/LoggerScenarioRule__mdt.object-meta.xml
@@ -1,6 +1,6 @@
-
- Log Scenario Rules
+
+ Logger Scenario Rules
Public
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/EndTime__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/EndTime__c.field-meta.xml
new file mode 100644
index 000000000..627e50bbe
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/EndTime__c.field-meta.xml
@@ -0,0 +1,9 @@
+
+
+ EndTime__c
+ false
+ DeveloperControlled
+
+ false
+ DateTime
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsAnonymousModeEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsAnonymousModeEnabled__c.field-meta.xml
new file mode 100644
index 000000000..1a25b9cbb
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsAnonymousModeEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsAnonymousModeEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, any logs generated will not have any user-specific details set - any fields related to the User, Profile, etc. will be null. Note: this feature only works properly when using the save method EVENT_BUS.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsApexSystemDebugLoggingEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsApexSystemDebugLoggingEnabled__c.field-meta.xml
new file mode 100644
index 000000000..fe1a7bf59
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsApexSystemDebugLoggingEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsApexSystemDebugLoggingEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, Logger will automatically call Apex's System.debug(). To help with performance, this option should be disabled in production unless you are actively troubleshooting an issue.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsDataMaskingEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsDataMaskingEnabled__c.field-meta.xml
new file mode 100644
index 000000000..d1df79402
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsDataMaskingEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsDataMaskingEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, any data-mask rules (configured in LogEntryDataMaskRule__mdt) will be automatically applied to log entry messages.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml
new file mode 100644
index 000000000..54f633604
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml
@@ -0,0 +1,12 @@
+
+
+ IsEnabled__c
+ Active
+ None
+ true
+ false
+ DeveloperControlled
+
+ Confidential
+ Checkbox
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsJavaScriptConsoleLoggingEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsJavaScriptConsoleLoggingEnabled__c.field-meta.xml
new file mode 100644
index 000000000..4257b4829
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsJavaScriptConsoleLoggingEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsJavaScriptConsoleLoggingEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, Logger will automatically call the browser's console.log() function when logging via lightning components. To help with performance, this option should be disabled in production unless you are actively troubleshooting an issue.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogAssignmentEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogAssignmentEnabled__c.field-meta.xml
new file mode 100644
index 000000000..b792f6364
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogAssignmentEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsLogAssignmentEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlleda
+ 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.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogRetentionOverrideEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogRetentionOverrideEnabled__c.field-meta.xml
new file mode 100644
index 000000000..9990dd15b
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLogRetentionOverrideEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsLogRetentionOverrideEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, the value specified in NumberOfDaysToRetainLogs__c (including null) will override the value specified in LoggerSettings__c.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLoggerEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLoggerEnabled__c.field-meta.xml
new file mode 100644
index 000000000..138579117
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsLoggerEnabled__c.field-meta.xml
@@ -0,0 +1,28 @@
+
+
+ IsLoggerEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsPlatformEventStorageLocationEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsPlatformEventStorageLocationEnabled__c.field-meta.xml
new file mode 100644
index 000000000..00df067b3
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsPlatformEventStorageLocationEnabled__c.field-meta.xml
@@ -0,0 +1,28 @@
+
+
+ IsPlatformEventStorageLocationEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsRecordFieldStrippingEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsRecordFieldStrippingEnabled__c.field-meta.xml
new file mode 100644
index 000000000..fc16f4794
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsRecordFieldStrippingEnabled__c.field-meta.xml
@@ -0,0 +1,30 @@
+
+
+ IsRecordFieldStrippingEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ When enabled, any time an SObject record is logged, only fields that the current user can access will be included in the record's JSON.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsSavingEnabled__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsSavingEnabled__c.field-meta.xml
new file mode 100644
index 000000000..9cb5a6e38
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/IsSavingEnabled__c.field-meta.xml
@@ -0,0 +1,29 @@
+
+
+ IsSavingEnabled__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ Controls if saving is enabled - when disabled, any calls to saveLog() are ignored.
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ true
+ false
+
+
+
+ false
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml
new file mode 100644
index 000000000..63ac8a31e
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml
@@ -0,0 +1,17 @@
+
+
+ NumberOfDaysToRetainLogs__c
+ Active
+ None
+ false
+ DeveloperControlled
+ This value is used to set the field Log__c.LogRetentionDate__c, which is then used by LogBatchPurger to delete old logs. To keep logs indefinitely, set this field to a blank value (null).
+
+ 4
+ false
+ 0
+ Confidential
+ Number
+ false
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/PlatformEventStorageLocation__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/PlatformEventStorageLocation__c.field-meta.xml
new file mode 100644
index 000000000..4ada74179
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/PlatformEventStorageLocation__c.field-meta.xml
@@ -0,0 +1,16 @@
+
+
+ PlatformEventStorageLocation__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ This controls the default location where LogEntryEvent__e records are stored - when null, LogEntryEvent__e records will not be stored.
+
+ 255
+ false
+ Confidential
+ Text
+ false
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/SaveMethod__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/SaveMethod__c.field-meta.xml
new file mode 100644
index 000000000..187aca46f
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/SaveMethod__c.field-meta.xml
@@ -0,0 +1,15 @@
+
+
+ SaveMethod__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ This controls the default save method used by Logger when calling saveLog(). In most situations, EVENT_BUS should be used.
+
+ 255
+ false
+ Confidential
+ Text
+ false
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/Scenario__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/Scenario__c.field-meta.xml
new file mode 100644
index 000000000..bc224c4b0
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/Scenario__c.field-meta.xml
@@ -0,0 +1,15 @@
+
+
+ Scenario__c
+ Active
+ false
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+
+ 255
+ true
+ Confidential
+ Text
+ true
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/StartTime__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/StartTime__c.field-meta.xml
new file mode 100644
index 000000000..5b8931a62
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/StartTime__c.field-meta.xml
@@ -0,0 +1,9 @@
+
+
+ StartTime__c
+ false
+ DeveloperControlled
+
+ false
+ DateTime
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml
new file mode 100644
index 000000000..9fae8b25c
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml
@@ -0,0 +1,55 @@
+
+
+ UserLoggingLevel__c
+ Active
+ PII;GDPR;CCPA
+ false
+ DeveloperControlled
+ Overrides the user's logging level (normally controlled via LoggerSettings__c.LoggingLevel__c) for any transactions with the specified Scenario
+
+ false
+ Confidential
+ Picklist
+
+ true
+
+ false
+
+ ERROR
+ false
+
+
+
+ WARN
+ false
+
+
+
+ INFO
+ false
+
+
+
+ DEBUG
+ false
+
+
+
+ FINE
+ false
+
+
+
+ FINER
+ false
+
+
+
+ FINEST
+ false
+
+
+
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/listViews/All.listView-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/listViews/All.listView-meta.xml
new file mode 100644
index 000000000..f8290bbd7
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerScenarioRule__mdt/listViews/All.listView-meta.xml
@@ -0,0 +1,18 @@
+
+
+ All
+ MasterLabel
+ DeveloperName
+ Scenario__c
+ IsEnabled__c
+ StartTime__c
+ EndTime__c
+ IsLoggerEnabled__c
+ UserLoggingLevel__c
+ NumberOfDaysToRetainLogs__c
+ IsSavingEnabled__c
+ SaveMethod__c
+ IsLogAssignmentEnabled__c
+ Everything
+
+
diff --git a/nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultScenario__c.field-meta.xml b/nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultScenario__c.field-meta.xml
new file mode 100644
index 000000000..dcaa84bfc
--- /dev/null
+++ b/nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultScenario__c.field-meta.xml
@@ -0,0 +1,16 @@
+
+
+ DefaultScenario__c
+ Active
+ CCPA;GDPR;PII
+ Sets a default scenario for the transaction
+ false
+ Sets a default scenario for the transaction
+
+ 255
+ false
+ Confidential
+ false
+ Text
+ false
+
diff --git a/nebula-logger/core/main/log-management/applications/LoggerConsole.app-meta.xml b/nebula-logger/core/main/log-management/applications/LoggerConsole.app-meta.xml
index 3b97e506c..596ab0f70 100644
--- a/nebula-logger/core/main/log-management/applications/LoggerConsole.app-meta.xml
+++ b/nebula-logger/core/main/log-management/applications/LoggerConsole.app-meta.xml
@@ -40,10 +40,10 @@
LogEntry__c
- LoggerScenario__c
+ Log__c
- Log__c
+ LoggerScenario__c
LoggerSettings
diff --git a/nebula-logger/core/main/log-management/classes/LogBatchPurgeController_Tests.cls b/nebula-logger/core/main/log-management/classes/LogBatchPurgeController_Tests.cls
index 603421630..f1fc6b011 100644
--- a/nebula-logger/core/main/log-management/classes/LogBatchPurgeController_Tests.cls
+++ b/nebula-logger/core/main/log-management/classes/LogBatchPurgeController_Tests.cls
@@ -3,7 +3,7 @@
// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. //
//------------------------------------------------------------------------------------------------//
@SuppressWarnings('PMD.ApexDoc, PMD.CyclomaticComplexity, PMD.ExcessiveParameterList, PMD.MethodNamingConventions,PMD.CognitiveComplexity')
-@IsTest
+@IsTest(IsParallel=false)
private class LogBatchPurgeController_Tests {
static final String CUSTOM_PURGE_ACTION = 'Custom';
static final String DEFAULT_PURGE_ACTION = 'Delete';
diff --git a/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls b/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls
index 036266e7d..2f14b36e4 100644
--- a/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls
+++ b/nebula-logger/core/main/log-management/classes/LogEntryEventHandler.cls
@@ -63,11 +63,18 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
}
private List filterLogEntryEventsToSave(List newLogEntryEvents) {
+ final String trueString = String.valueOf(true);
List logEntryEventsToSave = new List();
for (LogEntryEvent__e logEntryEvent : newLogEntryEvents) {
User loggingUser = new User(Id = logEntryEvent.LoggedById__c, ProfileId = logEntryEvent.ProfileId__c);
- LoggerSettings__c loggingUserSettings = Logger.getUserSettings(loggingUser);
- if (loggingUserSettings.DefaultPlatformEventStorageLocation__c == DEFAULT_STORAGE_LOCATION_NAME) {
+ String platformEventStorageLocation = Logger.getUserSettings(loggingUser).DefaultPlatformEventStorageLocation__c;
+ if (logEntryEvent.TransactionScenario__c != null && LoggerScenarioRule.getAll().containsKey(logEntryEvent.TransactionScenario__c) == true) {
+ LoggerScenarioRule__mdt scenarioRule = LoggerScenarioRule.getInstance(logEntryEvent.TransactionScenario__c);
+ if (scenarioRule.IsPlatformEventStorageLocationEnabled__c == trueString) {
+ platformEventStorageLocation = scenarioRule.PlatformEventStorageLocation__c;
+ }
+ }
+ if (platformEventStorageLocation == DEFAULT_STORAGE_LOCATION_NAME) {
logEntryEventsToSave.add(logEntryEvent);
}
}
@@ -75,19 +82,36 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
}
private void upsertLoggerScenarios() {
+ List scenarioFields = new List{
+ Schema.LogEntryEvent__e.EntryScenario__c,
+ Schema.LogEntryEvent__e.TransactionScenario__c
+ };
for (LogEntryEvent__e logEntryEvent : this.logEntryEvents) {
- if (String.isBlank(logEntryEvent.Scenario__c) == true || SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(logEntryEvent.Scenario__c)) {
- continue;
- }
+ for (Schema.SObjectField scenarioField : scenarioFields) {
+ String scenario = (String) logEntryEvent.get(scenarioField);
- LoggerScenario__c loggerScenario = new LoggerScenario__c(Name = logEntryEvent.Scenario__c, UniqueId__c = logEntryEvent.Scenario__c);
- loggerScenario.setOptions(DML_OPTIONS);
- SCENARIO_UNIQUE_ID_TO_SCENARIO.put(loggerScenario.UniqueId__c, loggerScenario);
+ if (String.isBlank(scenario) == true || SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(scenario)) {
+ continue;
+ }
+
+ LoggerScenario__c loggerScenario = new LoggerScenario__c(Name = scenario, UniqueId__c = scenario);
+ loggerScenario.setOptions(DML_OPTIONS);
+ SCENARIO_UNIQUE_ID_TO_SCENARIO.put(loggerScenario.UniqueId__c, loggerScenario);
+ }
}
List upsertResults = LoggerDataStore.getDatabase()
.upsertRecords(SCENARIO_UNIQUE_ID_TO_SCENARIO.values(), Schema.LoggerScenario__c.UniqueId__c, System.Test.isRunningTest());
LoggerEmailSender.sendErrorEmail(Schema.LoggerScenario__c.SObjectType, upsertResults);
+
+ // Requery to get the OwnerId field as well
+ for (LoggerScenario__c loggerScenario : [
+ SELECT Id, Name, OwnerId, UniqueId__c
+ FROM LoggerScenario__c
+ WHERE Id IN :SCENARIO_UNIQUE_ID_TO_SCENARIO.values()
+ ]) {
+ SCENARIO_UNIQUE_ID_TO_SCENARIO.put(loggerScenario.UniqueId__c, loggerScenario);
+ }
}
private void upsertLogs() {
@@ -102,12 +126,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
continue;
}
- User loggingUser = new User(Id = logEntryEvent.LoggedById__c, ProfileId = logEntryEvent.ProfileId__c);
- LoggerSettings__c loggingUserSettings = Logger.getUserSettings(loggingUser);
- Id logOwnerId = loggingUser.Id;
- if (logEntryEvent.UserType__c == GUEST_USER_TYPE || String.isBlank(logOwnerId) == true || loggingUserSettings.IsAnonymousModeEnabled__c == true) {
- logOwnerId = UserInfo.getUserId();
- }
+ Id logOwnerId = this.determineLogOwnerId(logEntryEvent);
Log__c log = new Log__c(
ApiReleaseNumber__c = recentLogWithApiReleaseDetails?.ApiReleaseNumber__c,
@@ -141,7 +160,7 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
ParentLogTransactionId__c = logEntryEvent.ParentLogTransactionId__c,
ProfileId__c = logEntryEvent.ProfileId__c,
ProfileName__c = logEntryEvent.ProfileName__c,
- Scenario__c = logEntryEvent.Scenario__c,
+ Scenario__c = logEntryEvent.TransactionScenario__c,
SessionId__c = logEntryEvent.SessionId__c,
SessionSecurityLevel__c = logEntryEvent.SessionSecurityLevel__c,
SessionType__c = logEntryEvent.SessionType__c,
@@ -161,8 +180,11 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
UserType__c = logEntryEvent.UserType__c
);
- if (String.isNotBlank(logEntryEvent.Scenario__c) == true && SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(logEntryEvent.Scenario__c) == true) {
- log.TransactionScenario__c = SCENARIO_UNIQUE_ID_TO_SCENARIO.get(logEntryEvent.Scenario__c).Id;
+ if (
+ String.isNotBlank(logEntryEvent.TransactionScenario__c) == true &&
+ SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(logEntryEvent.TransactionScenario__c) == true
+ ) {
+ log.TransactionScenario__c = SCENARIO_UNIQUE_ID_TO_SCENARIO.get(logEntryEvent.TransactionScenario__c).Id;
}
TRANSACTION_ID_TO_LOG.put(log.TransactionId__c, log);
@@ -274,6 +296,14 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
TriggerOperationType__c = logEntryEvent.TriggerOperationType__c,
TriggerSObjectType__c = logEntryEvent.TriggerSObjectType__c
);
+
+ if (
+ String.isNotBlank(logEntryEvent.EntryScenario__c) == true &&
+ SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(logEntryEvent.EntryScenario__c) == true
+ ) {
+ logEntry.EntryScenario__c = SCENARIO_UNIQUE_ID_TO_SCENARIO.get(logEntryEvent.EntryScenario__c).Id;
+ }
+
logEntry.setOptions(DML_OPTIONS);
this.logEntries.add(logEntry);
@@ -376,6 +406,27 @@ public without sharing class LogEntryEventHandler extends LoggerSObjectHandler {
}
}
+ private Id determineLogOwnerId(LogEntryEvent__e logEntryEvent) {
+ Id logOwnerId = logEntryEvent.LoggedById__c;
+
+ LoggerSettings__c loggingUserSettings = Logger.getUserSettings(new User(Id = logEntryEvent.LoggedById__c, ProfileId = logEntryEvent.ProfileId__c));
+ if (logEntryEvent.UserType__c == GUEST_USER_TYPE || String.isBlank(logOwnerId) == true || loggingUserSettings.IsAnonymousModeEnabled__c == true) {
+ logOwnerId = UserInfo.getUserId();
+ }
+
+ if (logEntryEvent.TransactionScenario__c != null && LoggerScenarioRule.getAll().containsKey(logEntryEvent.TransactionScenario__c) == true) {
+ LoggerScenarioRule__mdt scenarioRule = LoggerScenarioRule.getInstance(logEntryEvent.TransactionScenario__c);
+ if (
+ scenarioRule.IsLogAssignmentEnabled__c == String.valueOf(true) &&
+ SCENARIO_UNIQUE_ID_TO_SCENARIO.containsKey(logEntryEvent.TransactionScenario__c) == true
+ ) {
+ logOwnerId = SCENARIO_UNIQUE_ID_TO_SCENARIO.get(logEntryEvent.TransactionScenario__c).OwnerId;
+ }
+ }
+
+ return logOwnerId;
+ }
+
private Map getTagNameToId(Schema.SObjectType tagSObjectType) {
Map tagNameToId = new Map();
diff --git a/nebula-logger/core/main/log-management/classes/LogHandler.cls b/nebula-logger/core/main/log-management/classes/LogHandler.cls
index 670875665..8b0ef31e6 100644
--- a/nebula-logger/core/main/log-management/classes/LogHandler.cls
+++ b/nebula-logger/core/main/log-management/classes/LogHandler.cls
@@ -10,7 +10,6 @@
@SuppressWarnings('PMD.CognitiveComplexity, PMD.CyclomaticComplexity')
public without sharing class LogHandler extends LoggerSObjectHandler {
private static final Map MOCK_LOG_STATUS_TO_STATUS = new Map();
- private static final Map MOCK_SCENARIO_TO_SCENARIO_RULE = new Map();
@TestVisible
private List logs;
@@ -91,7 +90,7 @@ public without sharing class LogHandler extends LoggerSObjectHandler {
}
}
- if (logsToUpdate.isEmpty()) {
+ if (logsToUpdate.isEmpty() == true) {
return;
}
@@ -133,7 +132,6 @@ public without sharing class LogHandler extends LoggerSObjectHandler {
}
private void setLogRetentionDetails() {
- Map scenarioToScenarioRule = queryLogScenarioRules(this.logs, this.loggerScenariosById);
for (Log__c log : this.logs) {
// If the retention date has already been populated, leave it as-is
if (log.LogRetentionDate__c != null) {
@@ -144,16 +142,23 @@ public without sharing class LogHandler extends LoggerSObjectHandler {
LoggerSettings__c loggingUserSettings = getLoggingUserSettings(log);
// Load the configured scenario rule (if one exists)
- LogScenarioRule__mdt matchingScenarioRule;
+ LoggerScenarioRule__mdt matchingScenarioRule;
if (log.TransactionScenario__c != null) {
LoggerScenario__c loggerScenario = this.loggerScenariosById.get(log.TransactionScenario__c);
- matchingScenarioRule = scenarioToScenarioRule.get(loggerScenario.UniqueId__c);
+ matchingScenarioRule = LoggerScenarioRule.getInstance(loggerScenario.UniqueId__c);
+ if (
+ matchingScenarioRule != null &&
+ (matchingScenarioRule.IsLogRetentionOverrideEnabled__c == null ||
+ Boolean.valueOf(matchingScenarioRule.IsLogRetentionOverrideEnabled__c) != true)
+ ) {
+ matchingScenarioRule = null;
+ }
}
Integer daysToRetainLog = Integer.valueOf(
matchingScenarioRule != null ? matchingScenarioRule.NumberOfDaysToRetainLogs__c : loggingUserSettings.DefaultNumberOfDaysToRetainLogs__c
);
- // TODO Add new field to LogScenarioRule__mdt for setting the default log purge action (same concept as matchingScenarioRule.NumberOfDaysToRetainLogs__c above)
+ // TODO Add new field to LoggerScenarioRule__mdt for setting the default log purge action (same concept as matchingScenarioRule.NumberOfDaysToRetainLogs__c above)
// When daysToRetainLog is null, assume that the log should be kept forever,
// and set the retention date to null so that LogBatchPurger filters out/ignores the record
@@ -269,36 +274,8 @@ public without sharing class LogHandler extends LoggerSObjectHandler {
return usersByUsername;
}
- private static Map queryLogScenarioRules(List logs, Map loggerScenariosById) {
- Set scenarios = new Set();
- for (Log__c log : logs) {
- if (log.TransactionScenario__c != null && loggerScenariosById.containsKey(log.TransactionScenario__c) == true) {
- scenarios.add(loggerScenariosById.get(log.TransactionScenario__c).UniqueId__c);
- }
- }
-
- Map scenarioToScenarioRule = new Map();
- for (LogScenarioRule__mdt scenarioRule : LogScenarioRule__mdt.getAll().values()) {
- if (scenarioRule.IsEnabled__c == true && scenarios.contains(scenarioRule.Scenario__c) == true) {
- scenarioToScenarioRule.put(scenarioRule.Scenario__c, scenarioRule);
- }
- }
-
- if (System.Test.isRunningTest() == true) {
- scenarioToScenarioRule.clear();
- scenarioToScenarioRule.putAll(MOCK_SCENARIO_TO_SCENARIO_RULE);
- }
-
- return scenarioToScenarioRule;
- }
-
@TestVisible
private static void setMockLogStatus(LogStatus__mdt logStatus) {
MOCK_LOG_STATUS_TO_STATUS.put(logStatus.MasterLabel, logStatus);
}
-
- @TestVisible
- private static void setMockScenarioRule(LogScenarioRule__mdt scenarioRule) {
- MOCK_SCENARIO_TO_SCENARIO_RULE.put(scenarioRule.Scenario__c, scenarioRule);
- }
}
diff --git a/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls b/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls
index 1bf162c7f..dc5d67e00 100644
--- a/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls
+++ b/nebula-logger/core/main/log-management/classes/RelatedLogEntriesController.cls
@@ -152,36 +152,6 @@ public with sharing class RelatedLogEntriesController {
return relationshipName + '.' + displayFieldApiName;
}
- @SuppressWarnings('PMD.CognitiveComplexity')
- private static String getTabIcon(Schema.SObjectType sobjectType) {
- String sobjectName = sobjectType.getDescribe().getName();
-
- String tabIcon;
- for (Schema.DescribeTabSetResult tabSetResult : Schema.describeTabs()) {
- for (Schema.DescribeTabResult tabResult : tabSetResult.getTabs()) {
- if (tabResult.getSObjectName() != sobjectName) {
- continue;
- }
-
- String iconType = tabResult.isCustom() ? 'custom' : 'standard';
- String svgIconName;
- for (Schema.DescribeIconResult icon : tabResult.getIcons()) {
- if (icon.getContentType() != 'image/svg+xml') {
- continue;
- }
-
- svgIconName = icon.getUrl().substringAfterLast('/').replace('.svg', '');
- tabIcon = iconType + ':' + svgIconName;
- break;
- }
- }
- }
-
- return tabIcon;
- }
-
- // Inner classes
-
/**
* @description Inner, wrapper class that contains query result information after querying related log entries.
*/
@@ -216,12 +186,6 @@ public with sharing class RelatedLogEntriesController {
@AuraEnabled
public List records { get; set; }
- /**
- * @description contains the tab icon of the log entry, fetched using describe a call on the log entry sObject.
- */
- @AuraEnabled
- public String tabIcon { get; set; }
-
/**
* @description Contains the number of records returned via the log entries query.
*/
@@ -234,7 +198,6 @@ public with sharing class RelatedLogEntriesController {
this.label = LOG_ENTRY_SOBJECT_TYPE.getDescribe().getLabel();
this.labelPlural = LOG_ENTRY_SOBJECT_TYPE.getDescribe().getLabelPlural();
this.records = records;
- this.tabIcon = getTabIcon(LOG_SOBJECT_TYPE);
this.totalLogEntriesCount = totalLogEntriesCount;
}
}
diff --git a/nebula-logger/core/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml b/nebula-logger/core/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml
index fec8cef86..d4f2f92db 100644
--- a/nebula-logger/core/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml
+++ b/nebula-logger/core/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml
@@ -74,6 +74,16 @@
RecordTimestamp__cField
+
+
+
+ uiBehavior
+ readonly
+
+ Record.EntryScenario__c
+ RecordEntryScenario__cField
+
+
Facet-cb40f95d-9915-4ba5-815c-f3e53bcc4001
Facet
diff --git a/nebula-logger/core/main/log-management/flexipages/LoggerScenarioRecordPage.flexipage-meta.xml b/nebula-logger/core/main/log-management/flexipages/LoggerScenarioRecordPage.flexipage-meta.xml
index 6d62b2c12..52511ad56 100644
--- a/nebula-logger/core/main/log-management/flexipages/LoggerScenarioRecordPage.flexipage-meta.xml
+++ b/nebula-logger/core/main/log-management/flexipages/LoggerScenarioRecordPage.flexipage-meta.xml
@@ -60,6 +60,36 @@
relatedTabContent
Facet
+
+
+
+
+ parentFieldApiName
+ LoggerScenario__c.Id
+
+
+ relatedListApiName
+ LogEntries__r
+
+
+ relatedListComponentOverride
+ ADVGRID
+
+
+ rowsToDisplay
+ 30
+
+
+ showActionBar
+ true
+
+ force:relatedListSingleContainer
+ force_relatedListSingleContainer3
+
+
+ Facet-bf77ace2-6cee-4ca4-88b4-990633a74278
+ Facet
+
@@ -123,6 +153,20 @@
relatedListsTab
+
+
+
+ body
+ Facet-bf77ace2-6cee-4ca4-88b4-990633a74278
+
+
+ title
+ Log Entries
+
+ flexipage:tab
+ flexipage_tab3
+
+
diff --git a/nebula-logger/core/main/log-management/layouts/LogEntry__c-Log Entry Layout.layout-meta.xml b/nebula-logger/core/main/log-management/layouts/LogEntry__c-Log Entry Layout.layout-meta.xml
index af7eae2f0..7184402f5 100644
--- a/nebula-logger/core/main/log-management/layouts/LogEntry__c-Log Entry Layout.layout-meta.xml
+++ b/nebula-logger/core/main/log-management/layouts/LogEntry__c-Log Entry Layout.layout-meta.xml
@@ -31,7 +31,7 @@
Readonly
- EpochTimestamp__c
+ EntryScenario__c
@@ -455,7 +455,7 @@
false
false
- 00h1k000003yap8
+ 00h63000007CAv9
4
0
Default
diff --git a/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml b/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml
index c3c3dda3e..ee61a07f3 100644
--- a/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml
+++ b/nebula-logger/core/main/log-management/layouts/Log__c-Log Layout.layout-meta.xml
@@ -365,6 +365,7 @@
Origin__c
Message__c
RecordDetailedLink__c
+ EntryScenario__c
LoggingLevelWithImage__c
TransactionEntryNumber__c
LogEntry__c.Log__c
diff --git a/nebula-logger/core/main/log-management/layouts/LoggerScenario__c-Logger Scenario Layout.layout-meta.xml b/nebula-logger/core/main/log-management/layouts/LoggerScenario__c-Logger Scenario Layout.layout-meta.xml
index 3ecec04c0..2a123fa3f 100644
--- a/nebula-logger/core/main/log-management/layouts/LoggerScenario__c-Logger Scenario Layout.layout-meta.xml
+++ b/nebula-logger/core/main/log-management/layouts/LoggerScenario__c-Logger Scenario Layout.layout-meta.xml
@@ -103,13 +103,27 @@
StartTime__c
Desc
+
+ New
+ NAME
+ LoggedByUsernameLink__c
+ LoggingLevelWithImage__c
+ Log__c
+ LogTransactionId__c
+ OriginType__c
+ OriginLocation__c
+ Timestamp__c
+ LogEntry__c.EntryScenario__c
+ Timestamp__c
+ Desc
+
false
false
false
false
false
- 00h63000007c9rO
+ 00h63000007ebDj
4
0
Default
diff --git a/nebula-logger/core/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html b/nebula-logger/core/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html
index 68228387c..c1500d0e5 100644
--- a/nebula-logger/core/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html
+++ b/nebula-logger/core/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html
@@ -40,9 +40,9 @@
>
-
+
diff --git a/nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js b/nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js
index ebc7db69b..08cf00c7c 100644
--- a/nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js
+++ b/nebula-logger/core/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js
@@ -40,7 +40,6 @@ export default class RelatedLogEntries extends LightningElement {
wiredLogEntries(result) {
if (result.data) {
let queryResult = this.processResult(result.data);
-
this.queryResult = queryResult;
this.showComponent = queryResult.isAccessible;
this.title = queryResult.labelPlural + ' (' + queryResult.totalLogEntriesCount + ' Total)';
diff --git a/nebula-logger/core/main/log-management/objects/LogEntry__c/fields/EntryScenario__c.field-meta.xml b/nebula-logger/core/main/log-management/objects/LogEntry__c/fields/EntryScenario__c.field-meta.xml
new file mode 100644
index 000000000..1fd7b6b8a
--- /dev/null
+++ b/nebula-logger/core/main/log-management/objects/LogEntry__c/fields/EntryScenario__c.field-meta.xml
@@ -0,0 +1,14 @@
+
+
+ EntryScenario__c
+ Restrict
+ false
+
+ LoggerScenario__c
+ Log Entries
+ LogEntries
+ false
+ true
+ false
+ Lookup
+
diff --git a/nebula-logger/core/main/log-management/objects/LoggerScenario__c/LoggerScenario__c.object-meta.xml b/nebula-logger/core/main/log-management/objects/LoggerScenario__c/LoggerScenario__c.object-meta.xml
index ccc80c84b..7d7ecb2e9 100644
--- a/nebula-logger/core/main/log-management/objects/LoggerScenario__c/LoggerScenario__c.object-meta.xml
+++ b/nebula-logger/core/main/log-management/objects/LoggerScenario__c/LoggerScenario__c.object-meta.xml
@@ -147,7 +147,7 @@
Default
true
- LogScenarioCompactLayout
+ LoggerScenarioCompactLayout
Deployed
true
true
diff --git a/nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LogScenarioCompactLayout.compactLayout-meta.xml b/nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LoggerScenarioCompactLayout.compactLayout-meta.xml
similarity index 86%
rename from nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LogScenarioCompactLayout.compactLayout-meta.xml
rename to nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LoggerScenarioCompactLayout.compactLayout-meta.xml
index bb7e07920..de75ec00c 100644
--- a/nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LogScenarioCompactLayout.compactLayout-meta.xml
+++ b/nebula-logger/core/main/log-management/objects/LoggerScenario__c/compactLayouts/LoggerScenarioCompactLayout.compactLayout-meta.xml
@@ -1,6 +1,6 @@
- LogScenarioCompactLayout
+ LoggerScenarioCompactLayout
Name
UniqueId__c
OwnerId
diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml
index 6d201e6a1..b47fec9bb 100644
--- a/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml
+++ b/nebula-logger/core/main/log-management/permissionsets/LoggerAdmin.permissionset-meta.xml
@@ -200,6 +200,11 @@
LogEntry__c.DatabaseResultType__c
true
+
+ true
+ LogEntry__c.EntryScenario__c
+ true
+
false
LogEntry__c.EpochTimestamp__c
diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml
index 257756de7..2bc396df0 100644
--- a/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml
+++ b/nebula-logger/core/main/log-management/permissionsets/LoggerEndUser.permissionset-meta.xml
@@ -98,6 +98,11 @@
LogEntry__c.DatabaseResultType__c
true
+
+ false
+ LogEntry__c.EntryScenario__c
+ true
+
false
LogEntry__c.EpochTimestamp__c
diff --git a/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml b/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml
index a54f40fce..41d514060 100644
--- a/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml
+++ b/nebula-logger/core/main/log-management/permissionsets/LoggerLogViewer.permissionset-meta.xml
@@ -124,6 +124,11 @@
LogEntry__c.DatabaseResultType__c
true
+
+ false
+ LogEntry__c.EntryScenario__c
+ true
+
false
LogEntry__c.EpochTimestamp__c
diff --git a/nebula-logger/core/main/logger-engine/classes/Logger.cls b/nebula-logger/core/main/logger-engine/classes/Logger.cls
index 8a2c660ad..2413c884c 100644
--- a/nebula-logger/core/main/logger-engine/classes/Logger.cls
+++ b/nebula-logger/core/main/logger-engine/classes/Logger.cls
@@ -9,27 +9,31 @@
* @see LogEntryEventBuilder
* @see LogMessage
*/
-@SuppressWarnings('PMD.AvoidDebugStatements, PMD.AvoidGlobalModifier, PMD.CyclomaticComplexity, PMD.CognitiveComplexity, PMD.ExcessiveClassLength')
+@SuppressWarnings(
+ 'PMD.AvoidDebugStatements, PMD.AvoidGlobalModifier, PMD.CyclomaticComplexity, PMD.CognitiveComplexity, PMD.ExcessiveClassLength, PMD.StdCyclomaticComplexity'
+)
global with sharing class Logger {
// There's no reliable way to get the version number dynamically in Apex
@TestVisible
- private static final String CURRENT_VERSION_NUMBER = 'v4.8.1';
+ private static final String CURRENT_VERSION_NUMBER = 'v4.8.2';
private static final LoggingLevel DEFAULT_LOGGING_LEVEL = LoggingLevel.DEBUG;
private static final Set IGNORED_APEX_CLASSES = getIgnoredApexClasses();
private static final List LOG_ENTRIES_BUFFER = new List();
- private static final Map MOCK_SCENARIO_TO_SCENARIO_RULE = new Map();
+ private static final Map SAVE_METHOD_NAME_TO_SAVE_METHOD = new Map();
private static final String TRANSACTION_ID = new Uuid().getValue();
private static final Quiddity TRANSACTION_QUIDDITY = setTransactionQuiddity();
- private static final Boolean USE_FIRST_SPECIFIED_SCENARIO = LoggerParameter.getBoolean('UseFirstSpecifiedScenario', true);
+ private static final Boolean USE_FIRST_SPECIFIED_SCENARIO_AS_TRANSACTION_SCENARIO = LoggerParameter.getBoolean('UseFirstSpecifiedScenario', true);
+ private static String currentEntryScenario;
private static Integer currentTransactionEntryNumber = 1;
@TestVisible
private static String lastSaveMethodNameUsed;
+ private static List orderedScenarios = new List();
private static String parentLogTransactionId;
@TestVisible
private static Integer saveLogCallCount = 0;
private static Boolean suspendSaving = false;
- private static String transactionScenario = getUserSettings().DefaultLogScenario__c;
+ private static String transactionScenario;
private static LoggerSettings__c userSettings;
private static String transactionSaveMethodName {
@@ -57,6 +61,7 @@ global with sharing class Logger {
// The rest of the codebase should use a method in Logger.cls
System.debug(LoggingLevel.INFO, 'Logger - Version Number: ' + getVersionNumber());
System.debug(LoggingLevel.INFO, 'Logger - Transaction ID: ' + getTransactionId());
+ setScenario(getUserSettings().DefaultScenario__c);
}
/**
@@ -2440,11 +2445,7 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List deleteResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- } else {
- return logDatabaseErrors(loggingLevel, logMessage.getMessage(), deleteResults);
- }
+ return logDatabaseErrors(loggingLevel, logMessage.getMessage(), deleteResults);
}
/**
@@ -2455,10 +2456,6 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, String message, List deleteResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- }
-
List resultsToLog = new List();
for (Database.DeleteResult deleteResult : deleteResults) {
if (deleteResult.isSuccess() == false) {
@@ -2466,11 +2463,8 @@ global with sharing class Logger {
}
}
- LogEntryEventBuilder logEntryEventBuilder;
- if (resultsToLog.isEmpty() == false) {
- logEntryEventBuilder = newEntry(loggingLevel, message).setDatabaseResult(resultsToLog);
- }
- return logEntryEventBuilder;
+ Boolean shouldSave = resultsToLog.isEmpty() == false && isEnabled(loggingLevel) == true;
+ return newEntry(loggingLevel, message, shouldSave).setDatabaseResult(resultsToLog);
}
/**
@@ -2481,11 +2475,7 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List mergeResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- } else {
- return logDatabaseErrors(loggingLevel, logMessage.getMessage(), mergeResults);
- }
+ return logDatabaseErrors(loggingLevel, logMessage.getMessage(), mergeResults);
}
/**
@@ -2496,10 +2486,6 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, String message, List mergeResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- }
-
List resultsToLog = new List();
for (Database.MergeResult mergeResult : mergeResults) {
if (mergeResult.isSuccess() == false) {
@@ -2507,11 +2493,8 @@ global with sharing class Logger {
}
}
- LogEntryEventBuilder logEntryEventBuilder;
- if (resultsToLog.isEmpty() == false) {
- logEntryEventBuilder = newEntry(loggingLevel, message).setDatabaseResult(resultsToLog);
- }
- return logEntryEventBuilder;
+ Boolean shouldSave = resultsToLog.isEmpty() == false && isEnabled(loggingLevel) == true;
+ return newEntry(loggingLevel, message, shouldSave).setDatabaseResult(resultsToLog);
}
/**
@@ -2522,11 +2505,7 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List saveResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- } else {
- return logDatabaseErrors(loggingLevel, logMessage.getMessage(), saveResults);
- }
+ return logDatabaseErrors(loggingLevel, logMessage.getMessage(), saveResults);
}
/**
@@ -2537,10 +2516,6 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, String message, List saveResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- }
-
List resultsToLog = new List();
for (Database.SaveResult saveResult : saveResults) {
if (saveResult.isSuccess() == false) {
@@ -2548,11 +2523,8 @@ global with sharing class Logger {
}
}
- LogEntryEventBuilder logEntryEventBuilder;
- if (resultsToLog.isEmpty() == false) {
- logEntryEventBuilder = newEntry(loggingLevel, message).setDatabaseResult(resultsToLog);
- }
- return logEntryEventBuilder;
+ Boolean shouldSave = resultsToLog.isEmpty() == false && isEnabled(loggingLevel) == true;
+ return newEntry(loggingLevel, message, shouldSave).setDatabaseResult(resultsToLog);
}
/**
@@ -2563,11 +2535,7 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List upsertResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- } else {
- return logDatabaseErrors(loggingLevel, logMessage.getMessage(), upsertResults);
- }
+ return logDatabaseErrors(loggingLevel, logMessage.getMessage(), upsertResults);
}
/**
@@ -2578,10 +2546,6 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, String message, List upsertResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- }
-
List resultsToLog = new List();
for (Database.UpsertResult upsertResult : upsertResults) {
if (upsertResult.isSuccess() == false) {
@@ -2589,11 +2553,8 @@ global with sharing class Logger {
}
}
- LogEntryEventBuilder logEntryEventBuilder;
- if (resultsToLog.isEmpty() == false) {
- logEntryEventBuilder = newEntry(loggingLevel, message).setDatabaseResult(resultsToLog);
- }
- return logEntryEventBuilder;
+ Boolean shouldSave = resultsToLog.isEmpty() == false && isEnabled(loggingLevel) == true;
+ return newEntry(loggingLevel, message, shouldSave).setDatabaseResult(resultsToLog);
}
/**
@@ -2604,11 +2565,7 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List undeleteResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- } else {
- return logDatabaseErrors(loggingLevel, logMessage.getMessage(), undeleteResults);
- }
+ return logDatabaseErrors(loggingLevel, logMessage.getMessage(), undeleteResults);
}
/**
@@ -2619,10 +2576,6 @@ global with sharing class Logger {
* @return The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors
*/
global static LogEntryEventBuilder logDatabaseErrors(LoggingLevel loggingLevel, String message, List undeleteResults) {
- if (isEnabled(loggingLevel) == false) {
- return null;
- }
-
List resultsToLog = new List();
for (Database.UndeleteResult undeleteResult : undeleteResults) {
if (undeleteResult.isSuccess() == false) {
@@ -2630,11 +2583,8 @@ global with sharing class Logger {
}
}
- LogEntryEventBuilder logEntryEventBuilder;
- if (resultsToLog.isEmpty() == false) {
- logEntryEventBuilder = newEntry(loggingLevel, message).setDatabaseResult(resultsToLog);
- }
- return logEntryEventBuilder;
+ Boolean shouldSave = resultsToLog.isEmpty() == false && isEnabled(loggingLevel) == true;
+ return newEntry(loggingLevel, message, shouldSave).setDatabaseResult(resultsToLog);
}
/**
@@ -2686,36 +2636,80 @@ global with sharing class Logger {
* @return The value currently set as the current transaction's scenario
*/
global static String getScenario() {
- return transactionScenario;
+ return currentEntryScenario;
}
/**
- * @description Sets the scenario name for the current transaction - this is stored in `LogEntryEvent__e.Scenario__c`
- * and `Log__c.Scenario__c`, and can be used to filter & group logs
+ * @description Sets the current scenario, which can be used to identify modules or groupings of for the current transaction
* @param scenario The name to use for the current transaction's scenario
*/
+ @SuppressWarnings('PMD.NcssMethodCount')
global static void setScenario(String scenario) {
- if (USE_FIRST_SPECIFIED_SCENARIO == true && String.isNotBlank(transactionScenario) == true) {
- return;
+ if (USE_FIRST_SPECIFIED_SCENARIO_AS_TRANSACTION_SCENARIO == false || String.isBlank(transactionScenario) == true) {
+ transactionScenario = scenario;
}
- transactionScenario = scenario;
+ if (String.isNotBlank(scenario) == true && scenario == currentEntryScenario) {
+ return;
+ }
- LogScenarioRule__mdt matchingScenarioRule;
- for (LogScenarioRule__mdt scenarioRule : LogScenarioRule__mdt.getAll().values()) {
- if (scenarioRule.IsEnabled__c == true && scenarioRule.Scenario__c == scenario) {
- matchingScenarioRule = scenarioRule;
- break;
+ currentEntryScenario = scenario;
+ orderedScenarios.add(scenario);
+ LoggerScenarioRule__mdt matchingScenarioRule = LoggerScenarioRule.getInstance(scenario);
+ if (matchingScenarioRule != null) {
+ LoggerSettings__c userSettings = getUserSettings();
+ if (String.isNotBlank(matchingScenarioRule.IsLoggerEnabled__c) == true) {
+ userSettings.IsEnabled__c = Boolean.valueOf(matchingScenarioRule.IsLoggerEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsAnonymousModeEnabled__c) == true) {
+ userSettings.IsAnonymousModeEnabled__c = Boolean.valueOf(matchingScenarioRule.IsAnonymousModeEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsApexSystemDebugLoggingEnabled__c) == true) {
+ userSettings.IsApexSystemDebugLoggingEnabled__c = Boolean.valueOf(matchingScenarioRule.IsApexSystemDebugLoggingEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsDataMaskingEnabled__c) == true) {
+ userSettings.IsDataMaskingEnabled__c = Boolean.valueOf(matchingScenarioRule.IsDataMaskingEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsJavaScriptConsoleLoggingEnabled__c) == true) {
+ userSettings.IsJavaScriptConsoleLoggingEnabled__c = Boolean.valueOf(matchingScenarioRule.IsJavaScriptConsoleLoggingEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsRecordFieldStrippingEnabled__c) == true) {
+ userSettings.IsRecordFieldStrippingEnabled__c = Boolean.valueOf(matchingScenarioRule.IsRecordFieldStrippingEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.IsSavingEnabled__c) == true) {
+ userSettings.IsSavingEnabled__c = Boolean.valueOf(matchingScenarioRule.IsSavingEnabled__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.SaveMethod__c) == true) {
+ setSaveMethod(matchingScenarioRule.SaveMethod__c);
+ }
+ if (String.isNotBlank(matchingScenarioRule.UserLoggingLevel__c) == true) {
+ userSettings.LoggingLevel__c = matchingScenarioRule.UserLoggingLevel__c;
}
}
+ }
- if (System.Test.isRunningTest() == true) {
- matchingScenarioRule = MOCK_SCENARIO_TO_SCENARIO_RULE.get(scenario);
+ /**
+ * @description End the specified scenario, if it's the currently active scenario,
+ * and rolls back to the previous scenario (if a previous scenario was specified in the current transaction)
+ * @param scenario The name of the scenario to end
+ */
+ public static void endScenario(String scenario) {
+ if (String.isBlank(scenario) == true || scenario != currentEntryScenario || orderedScenarios.isEmpty() == true) {
+ return;
}
- if (matchingScenarioRule != null) {
- getUserSettings().LoggingLevel__c = matchingScenarioRule.UserLoggingLevel__c;
+ Integer lastScenarioIndex = orderedScenarios.size() - 1;
+ orderedScenarios.remove(lastScenarioIndex);
+ String previousScenario;
+ if (orderedScenarios.isEmpty() == false) {
+ Integer previousScenarioIndex = orderedScenarios.size() - 1;
+ previousScenario = orderedScenarios.remove(previousScenarioIndex);
+ }
+ if (String.isBlank(previousScenario) == true) {
+ currentEntryScenario = null;
}
+
+ setScenario(previousScenario);
}
/**
@@ -2742,7 +2736,7 @@ global with sharing class Logger {
* @param saveMethod The enum value of Logger.SaveMethod to use for any other calls to saveLog() in the current transaction
*/
global static void setSaveMethod(SaveMethod saveMethod) {
- transactionSaveMethodName = saveMethod.name();
+ setSaveMethod(saveMethod.name());
}
/**
@@ -2792,7 +2786,7 @@ global with sharing class Logger {
if (logEntryEventBuilder.shouldSave() == true) {
LogEntryEvent__e logEntryEvent = logEntryEventBuilder.getLogEntryEvent();
logEntryEvent.ParentLogTransactionId__c = getParentLogTransactionId();
- logEntryEvent.Scenario__c = transactionScenario;
+ logEntryEvent.TransactionScenario__c = transactionScenario;
logEntryEvents.add(logEntryEvent);
}
@@ -2905,12 +2899,14 @@ global with sharing class Logger {
private static LogEntryEventBuilder newEntry(LoggingLevel loggingLevel, Boolean shouldSave) {
LogEntryEventBuilder logEntryEventBuilder = new LogEntryEventBuilder(getUserSettings(), loggingLevel, shouldSave, IGNORED_APEX_CLASSES);
if (logEntryEventBuilder.shouldSave() == true) {
- logEntryEventBuilder.getLogEntryEvent().LoggerVersionNumber__c = CURRENT_VERSION_NUMBER;
- logEntryEventBuilder.getLogEntryEvent().SystemMode__c = getCurrentQuiddity()?.name();
- logEntryEventBuilder.getLogEntryEvent().TransactionEntryNumber__c = currentTransactionEntryNumber++;
- logEntryEventBuilder.getLogEntryEvent().TransactionId__c = getTransactionId();
- logEntryEventBuilder.getLogEntryEvent().UserLoggingLevel__c = userLoggingLevel.name();
- logEntryEventBuilder.getLogEntryEvent().UserLoggingLevelOrdinal__c = userLoggingLevel.ordinal();
+ LogEntryEvent__e logEntryEvent = logEntryEventBuilder.getLogEntryEvent();
+ logEntryEvent.EntryScenario__c = currentEntryScenario;
+ logEntryEvent.LoggerVersionNumber__c = CURRENT_VERSION_NUMBER;
+ logEntryEvent.SystemMode__c = getCurrentQuiddity()?.name();
+ logEntryEvent.TransactionEntryNumber__c = currentTransactionEntryNumber++;
+ logEntryEvent.TransactionId__c = getTransactionId();
+ logEntryEvent.UserLoggingLevel__c = userLoggingLevel.name();
+ logEntryEvent.UserLoggingLevelOrdinal__c = userLoggingLevel.ordinal();
LOG_ENTRIES_BUFFER.add(logEntryEventBuilder);
}
@@ -2933,25 +2929,18 @@ global with sharing class Logger {
}
}
- @TestVisible
- private static void setMockScenarioRule(LogScenarioRule__mdt scenarioRule) {
- // TODO Add validation for DeveloperName and Scenario__c fields != null
- // if (String.isBlank(scenarioRule.DeveloperName) == true) {
- // throw new IllegalArgumentException('DeveloperName is required on `LogScenarioRule__mdt: \n' + JSON.serializePretty(scenarioRule));
- // }
- // if (String.isBlank(scenarioRule.Scenario__c) == true) {
- // throw new IllegalArgumentException('Scenario__c is required on `LogScenarioRule__mdt: \n' + JSON.serializePretty(scenarioRule));
- // }
+ private static SaveMethod getSaveMethod(String saveMethodName) {
+ if (SAVE_METHOD_NAME_TO_SAVE_METHOD.isEmpty() == true) {
+ for (SaveMethod method : SaveMethod.values()) {
+ SAVE_METHOD_NAME_TO_SAVE_METHOD.put(method.name(), method);
+ }
+ }
- MOCK_SCENARIO_TO_SCENARIO_RULE.put(scenarioRule.Scenario__c, scenarioRule);
+ return SAVE_METHOD_NAME_TO_SAVE_METHOD.get(saveMethodName);
}
- private static SaveMethod getSaveMethod(String saveMethodName) {
- try {
- return SaveMethod.valueOf(saveMethodName);
- } catch (NoSuchElementException ex) {
- return null;
- }
+ private static void setSaveMethod(String saveMethodName) {
+ transactionSaveMethodName = saveMethodName;
}
private static String getSuspendSavingLogSystemMessage() {
diff --git a/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/EntryScenario__c.field-meta.xml b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/EntryScenario__c.field-meta.xml
new file mode 100644
index 000000000..124009786
--- /dev/null
+++ b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/EntryScenario__c.field-meta.xml
@@ -0,0 +1,16 @@
+
+
+ EntryScenario__c
+ Active
+ CCPA;GDPR;PII
+ false
+ false
+ false
+ false
+
+ 255
+ false
+ Confidential
+ Text
+ false
+
diff --git a/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/Scenario__c.field-meta.xml b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/Scenario__c.field-meta.xml
index f0e02127a..f6b74aa73 100644
--- a/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/Scenario__c.field-meta.xml
+++ b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/Scenario__c.field-meta.xml
@@ -1,13 +1,13 @@
Scenario__c
- Active
+ DeprecateCandidate
CCPA;GDPR;PII
false
false
false
false
-
+
255
false
Confidential
diff --git a/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/TransactionScenario__c.field-meta.xml b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/TransactionScenario__c.field-meta.xml
new file mode 100644
index 000000000..5171b7a74
--- /dev/null
+++ b/nebula-logger/core/main/logger-engine/objects/LogEntryEvent__e/fields/TransactionScenario__c.field-meta.xml
@@ -0,0 +1,16 @@
+
+
+ TransactionScenario__c
+ Active
+ CCPA;GDPR;PII
+ false
+ false
+ false
+ false
+
+ 255
+ false
+ Confidential
+ Text
+ false
+
diff --git a/nebula-logger/core/tests/LoggerCore.testSuite-meta.xml b/nebula-logger/core/tests/LoggerCore.testSuite-meta.xml
index 79b6414a9..357bfb207 100644
--- a/nebula-logger/core/tests/LoggerCore.testSuite-meta.xml
+++ b/nebula-logger/core/tests/LoggerCore.testSuite-meta.xml
@@ -21,6 +21,7 @@
LoggerParameter_Tests
LoggerPlugin_Tests
LoggerScenarioHandler_Tests
+ LoggerScenarioRule_Tests
LoggerSettingsController_Tests
LoggerSObjectHandler_Tests
LoggerSObjectMetadata_Tests
diff --git a/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls b/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls
new file mode 100644
index 000000000..d5be721fe
--- /dev/null
+++ b/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls
@@ -0,0 +1,129 @@
+//------------------------------------------------------------------------------------------------//
+// This file is part of the Nebula Logger project, released under the MIT License. //
+// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. //
+//------------------------------------------------------------------------------------------------//
+
+@SuppressWarnings('PMD.ApexDoc, PMD.MethodNamingConventions')
+@IsTest(IsParallel=true)
+private class LoggerScenarioRule_Tests {
+ @IsTest
+ static void it_should_throw_exception_when_mock_record_scenario_is_null() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(Scenario__c = null);
+ Exception thrownIllegalArgumentException;
+
+ try {
+ LoggerScenarioRule.setMock(mockRule);
+ } catch (IllegalArgumentException ex) {
+ thrownIllegalArgumentException = ex;
+ }
+
+ System.assertNotEquals(null, thrownIllegalArgumentException);
+ System.assertEquals(true, thrownIllegalArgumentException.getMessage().startsWith('Scenario__c is required on `LoggerScenarioRule__mdt'));
+ }
+
+ @IsTest
+ static void it_should_load_all_mock_records() {
+ List mockRules = new List();
+ for (Integer i = 0; i < 5; i++) {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(IsEnabled__c = true, Scenario__c = 'Some Scenario #' + i);
+ LoggerScenarioRule.setMock(mockRule);
+ mockRules.add(mockRule);
+ }
+
+ Map returnedScenariosToRule = LoggerScenarioRule.getAll();
+
+ System.assertEquals(mockRules.size(), returnedScenariosToRule.size());
+ for (LoggerScenarioRule__mdt mockRule : mockRules) {
+ System.assertEquals(true, returnedScenariosToRule.containsKey(mockRule.Scenario__c));
+ System.assertEquals(mockRule, returnedScenariosToRule.get(mockRule.Scenario__c));
+ }
+ }
+
+ @IsTest
+ static void it_should_load_configured_rule_when_start_and_end_time_are_both_null() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = null,
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario',
+ StartTime__c = null
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(mockRule, returnedRule);
+ }
+
+ @IsTest
+ static void it_should_load_configured_rule_when_start_time_is_valid_and_end_time_is_null() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = null,
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario',
+ StartTime__c = System.now().addMinutes(-1)
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(mockRule, returnedRule);
+ }
+
+ @IsTest
+ static void it_should_load_configured_rule_when_start_time_is_null_and_end_time_is_valid() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = System.now().addMinutes(1),
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario'
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(mockRule, returnedRule);
+ }
+
+ @IsTest
+ static void it_should_load_configured_rule_when_start_and_end_time_are_both_valid() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = System.now().addMinutes(1),
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario',
+ StartTime__c = System.now().addMinutes(-1)
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(mockRule, returnedRule);
+ }
+
+ @IsTest
+ static void it_should_not_load_configured_rule_when_start_time_is_in_the_future() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = null,
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario',
+ StartTime__c = System.now().addMinutes(1)
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(null, returnedRule);
+ }
+
+ @IsTest
+ static void it_should_not_load_configured_rule_when_end_time_is_in_the_past() {
+ LoggerScenarioRule__mdt mockRule = new LoggerScenarioRule__mdt(
+ EndTime__c = System.now().addMinutes(-1),
+ IsEnabled__c = true,
+ Scenario__c = 'Some Scenario'
+ );
+ LoggerScenarioRule.setMock(mockRule);
+
+ LoggerScenarioRule__mdt returnedRule = LoggerScenarioRule.getInstance(mockRule.Scenario__c);
+
+ System.assertEquals(null, returnedRule);
+ }
+}
diff --git a/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls-meta.xml b/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls-meta.xml
new file mode 100644
index 000000000..c47403d0b
--- /dev/null
+++ b/nebula-logger/core/tests/configuration/classes/LoggerScenarioRule_Tests.cls-meta.xml
@@ -0,0 +1,5 @@
+
+
+ 55.0
+ Active
+
diff --git a/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls
index 981e05f86..0d48e7d9a 100644
--- a/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls
+++ b/nebula-logger/core/tests/log-management/classes/LogEntryEventHandler_Tests.cls
@@ -4,7 +4,7 @@
//------------------------------------------------------------------------------------------------//
@SuppressWarnings('PMD.ApexDoc, PMD.CyclomaticComplexity, PMD.ExcessiveParameterList, PMD.MethodNamingConventions, PMD.NcssMethodCount, PMD.NcssTypeCount')
-@IsTest(IsParallel=true)
+@IsTest(IsParallel=false)
private class LogEntryEventHandler_Tests {
private static final String MOCK_RELEASE_NUMBER = '230.12.2';
private static final String MOCK_RELEASE_VERSION = 'Spring \'21 Patch 12.2';
@@ -58,7 +58,7 @@ private class LogEntryEventHandler_Tests {
}
@IsTest
- static void it_should_not_create_log_or_log_entry_data_when_platform_event_storage_is_disabled() {
+ static void it_should_not_create_log_or_log_entry_data_when_platform_event_storage_location_is_null_in_logger_settings() {
LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
@@ -89,6 +89,47 @@ private class LogEntryEventHandler_Tests {
System.assertEquals(0, countOfLogEntries);
}
+ @IsTest
+ static void it_should_not_create_log_or_log_entry_data_when_platform_event_storage_location_is_null_in_logger_scenario_rule() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
+ LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
+ Integer countOfLogs = [SELECT COUNT() FROM Log__c];
+ System.assertEquals(0, countOfLogs);
+ Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c];
+ System.assertEquals(0, countOfLogEntries);
+ LoggerSettings__c settings = Logger.getUserSettings();
+ settings.IsEnabled__c = true;
+ settings.IsSavingEnabled__c = true;
+ settings.DefaultPlatformEventStorageLocation__c = LogEntryEventHandler.DEFAULT_STORAGE_LOCATION_NAME;
+ upsert settings;
+ LogEntryEvent__e logEntryEvent = createLogEntryEvent();
+ logEntryEvent.TransactionScenario__c = 'some scenario with a configured rule';
+ LoggerScenarioRule.setMock(
+ new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsPlatformEventStorageLocationEnabled__c = String.valueOf(true),
+ PlatformEventStorageLocation__c = null,
+ Scenario__c = logEntryEvent.TransactionScenario__c
+ )
+ );
+
+ Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent);
+ LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
+
+ System.assertEquals(true, saveResult.isSuccess(), saveResult.getErrors());
+ System.assertEquals(
+ 1,
+ LoggerSObjectHandler.getExecutedHandlers().get(Schema.LogEntryEvent__e.SObjectType).size(),
+ 'Handler class should have executed one time for AFTER_INSERT'
+ );
+ countOfLogs = [SELECT COUNT() FROM Log__c];
+ System.assertEquals(0, countOfLogs);
+ countOfLogEntries = [SELECT COUNT() FROM LogEntry__c];
+ System.assertEquals(0, countOfLogEntries);
+ }
+
@IsTest
static void it_should_normalize_event_data_into_log_and_log_entry_when_no_scenario_specified() {
LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
@@ -96,7 +137,7 @@ private class LogEntryEventHandler_Tests {
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
LogEntryEvent__e logEntryEvent = createLogEntryEvent();
- logEntryEvent.Scenario__c = null;
+ logEntryEvent.TransactionScenario__c = null;
Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent);
LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
@@ -161,7 +202,8 @@ private class LogEntryEventHandler_Tests {
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
LogEntryEvent__e logEntryEvent = createLogEntryEvent();
- logEntryEvent.Scenario__c = '0'.repeat(Schema.LogEntryEvent__e.Scenario__c.getDescribe().getLength());
+ logEntryEvent.EntryScenario__c = null;
+ logEntryEvent.TransactionScenario__c = '0'.repeat(Schema.LogEntryEvent__e.Scenario__c.getDescribe().getLength());
Database.SaveResult saveResult = LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent);
LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
@@ -172,6 +214,7 @@ private class LogEntryEventHandler_Tests {
LoggerSObjectHandler.getExecutedHandlers().get(Schema.LogEntryEvent__e.SObjectType).size(),
'Handler class should have executed one time for AFTER_INSERT'
);
+ System.assertEquals(1, [SELECT COUNT() FROM LoggerScenario__c]);
Log__c log = getLog();
System.assertNotEquals(null, log.TransactionScenario__c);
System.assertEquals(1, log.LogEntries__r.size());
@@ -182,7 +225,7 @@ private class LogEntryEventHandler_Tests {
}
@IsTest
- static void it_should_upsert_logger_scenarios_when_scenario_specified() {
+ static void it_should_upsert_logger_scenarios_when_transaction_scenario_specified() {
LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
@@ -191,9 +234,11 @@ private class LogEntryEventHandler_Tests {
insert existingLogScenario;
System.assertEquals(1, [SELECT COUNT() FROM LoggerScenario__c]);
LogEntryEvent__e firstLogEntryEvent = createLogEntryEvent();
- firstLogEntryEvent.Scenario__c = existingLogScenario.UniqueId__c;
+ firstLogEntryEvent.EntryScenario__c = null;
+ firstLogEntryEvent.TransactionScenario__c = existingLogScenario.UniqueId__c;
LogEntryEvent__e secondLogEntryEvent = createLogEntryEvent();
- secondLogEntryEvent.Scenario__c = existingLogScenario.UniqueId__c;
+ secondLogEntryEvent.EntryScenario__c = null;
+ secondLogEntryEvent.TransactionScenario__c = existingLogScenario.UniqueId__c;
List logEntryEvents = new List{ firstLogEntryEvent, secondLogEntryEvent };
List saveResults = LoggerMockDataStore.getEventBus().publishRecords(logEntryEvents);
@@ -215,7 +260,93 @@ private class LogEntryEventHandler_Tests {
for (Integer i = 0; i < logEntryEvents.size(); i++) {
LogEntryEvent__e logEntryEvent = logEntryEvents.get(i);
LogEntry__c logEntry = log.LogEntries__r.get(i);
- System.assertEquals(logEntryEvent.TransactionId__c, log.TransactionId__c);
+ System.assertEquals(logEntryEvent.TransactionScenario__c, log.TransactionScenario__r.UniqueId__c);
+ validateLogFields(logEntryEvent, log);
+ validateLogEntryFields(logEntryEvent, logEntry);
+ }
+ }
+
+ @IsTest
+ static void it_should_upsert_logger_scenarios_when_entry_scenario_specified() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
+ LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
+ LoggerScenario__c existingLoggerScenario = new LoggerScenario__c(UniqueId__c = 'hello, world');
+ insert existingLoggerScenario;
+ String newScenario = 'some new value';
+ System.assertEquals(1, [SELECT COUNT() FROM LoggerScenario__c]);
+ LogEntryEvent__e firstLogEntryEvent = createLogEntryEvent();
+ firstLogEntryEvent.EntryScenario__c = existingLoggerScenario.UniqueId__c;
+ firstLogEntryEvent.TransactionScenario__c = null;
+ LogEntryEvent__e secondLogEntryEvent = createLogEntryEvent();
+ secondLogEntryEvent.EntryScenario__c = newScenario;
+ secondLogEntryEvent.TransactionScenario__c = null;
+ List logEntryEvents = new List{ firstLogEntryEvent, secondLogEntryEvent };
+
+ List saveResults = LoggerMockDataStore.getEventBus().publishRecords(logEntryEvents);
+ LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
+
+ System.assertEquals(logEntryEvents.size(), saveResults.size());
+ for (Database.SaveResult saveResult : saveResults) {
+ System.assertEquals(true, saveResult.isSuccess(), saveResult.getErrors());
+ }
+ System.assertEquals(
+ 1,
+ LoggerSObjectHandler.getExecutedHandlers().get(Schema.LogEntryEvent__e.SObjectType).size(),
+ 'Handler class should have executed one time for AFTER_INSERT'
+ );
+ System.assertEquals(2, [SELECT COUNT() FROM LoggerScenario__c]);
+ Log__c log = getLog();
+ System.assertEquals(logEntryEvents.size(), log.LogEntries__r.size());
+ for (Integer i = 0; i < logEntryEvents.size(); i++) {
+ LogEntryEvent__e logEntryEvent = logEntryEvents.get(i);
+ LogEntry__c logEntry = log.LogEntries__r.get(i);
+ System.assertEquals(logEntryEvent.EntryScenario__c, logEntry.EntryScenario__r.UniqueId__c);
+ validateLogFields(logEntryEvent, log);
+ validateLogEntryFields(logEntryEvent, logEntry);
+ }
+ }
+
+ @IsTest
+ static void it_should_upsert_logger_scenarios_when_transaction_and_entry_scenarios_specified() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
+ LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
+ LoggerScenario__c existingLoggerScenario = new LoggerScenario__c(UniqueId__c = 'hello, world');
+ insert existingLoggerScenario;
+ String newTransactionScenario = 'some new value';
+ String newEntryScenario = 'some OTHER new value';
+ System.assertEquals(1, [SELECT COUNT() FROM LoggerScenario__c]);
+ LogEntryEvent__e firstLogEntryEvent = createLogEntryEvent();
+ firstLogEntryEvent.EntryScenario__c = existingLoggerScenario.UniqueId__c;
+ firstLogEntryEvent.TransactionScenario__c = newTransactionScenario;
+ LogEntryEvent__e secondLogEntryEvent = createLogEntryEvent();
+ secondLogEntryEvent.EntryScenario__c = newEntryScenario;
+ secondLogEntryEvent.TransactionScenario__c = newTransactionScenario;
+ List logEntryEvents = new List{ firstLogEntryEvent, secondLogEntryEvent };
+
+ List saveResults = LoggerMockDataStore.getEventBus().publishRecords(logEntryEvents);
+ LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
+
+ System.assertEquals(logEntryEvents.size(), saveResults.size());
+ for (Database.SaveResult saveResult : saveResults) {
+ System.assertEquals(true, saveResult.isSuccess(), saveResult.getErrors());
+ }
+ System.assertEquals(
+ 1,
+ LoggerSObjectHandler.getExecutedHandlers().get(Schema.LogEntryEvent__e.SObjectType).size(),
+ 'Handler class should have executed one time for AFTER_INSERT'
+ );
+ System.assertEquals(3, [SELECT COUNT() FROM LoggerScenario__c]);
+ Log__c log = getLog();
+ System.assertEquals(logEntryEvents.size(), log.LogEntries__r.size());
+ for (Integer i = 0; i < logEntryEvents.size(); i++) {
+ LogEntryEvent__e logEntryEvent = logEntryEvents.get(i);
+ LogEntry__c logEntry = log.LogEntries__r.get(i);
+ System.assertEquals(logEntryEvent.TransactionScenario__c, log.TransactionScenario__r.UniqueId__c);
+ System.assertEquals(logEntryEvent.EntryScenario__c, logEntry.EntryScenario__r.UniqueId__c);
validateLogFields(logEntryEvent, log);
validateLogEntryFields(logEntryEvent, logEntry);
}
@@ -293,6 +424,34 @@ private class LogEntryEventHandler_Tests {
System.assertEquals(automatedProcessUser.Id, log.OwnerId);
}
+ @IsTest
+ static void it_should_set_logger_scenario_owner_as_log_owner_when_log_assignment_enabled_via_logger_scenario_rule() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
+ LoggerTestConfigurator.setupMockSObjectHandlerConfigurations();
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LoggerScenario__c.SObjectType).IsEnabled__c = false;
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.Log__c.SObjectType).IsEnabled__c = false;
+ LoggerTestConfigurator.getSObjectHandlerConfiguration(Schema.LogEntry__c.SObjectType).IsEnabled__c = false;
+ User loggerScenarioOwner = LoggerMockDataCreator.createUser();
+ insert loggerScenarioOwner;
+ LoggerScenario__c loggerScenario = new LoggerScenario__c(Name = 'Some Scenario', OwnerId = loggerScenarioOwner.Id, UniqueId__c = 'Some Scenario');
+ insert loggerScenario;
+ LogEntryEvent__e logEntryEvent = createLogEntryEvent();
+ logEntryEvent.TransactionScenario__c = loggerScenario.UniqueId__c;
+ LoggerScenarioRule.setMock(
+ new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsLogAssignmentEnabled__c = String.valueOf(true),
+ Scenario__c = logEntryEvent.TransactionScenario__c
+ )
+ );
+
+ LoggerMockDataStore.getEventBus().publishRecord(logEntryEvent);
+ LoggerMockDataStore.getEventBus().deliver(new LogEntryEventHandler());
+
+ Log__c log = getLog();
+ System.assertEquals(loggerScenario.OwnerId, log.OwnerId);
+ }
+
// TODO - testing topics is tricky. Within the unlocked package, we can test it,
// but for people that prefer using the unpackaged metadata + don't use topics,
// the tests would fail. Need to further investigate ways to handle this
@@ -805,6 +964,9 @@ private class LogEntryEventHandler_Tests {
DatabaseResultCollectionType__c,
DatabaseResultJson__c,
DatabaseResultType__c,
+ EntryScenario__c,
+ EntryScenario__r.Name,
+ EntryScenario__r.UniqueId__c,
EpochTimestamp__c,
ExceptionStackTrace__c,
ExceptionType__c,
@@ -908,12 +1070,6 @@ private class LogEntryEventHandler_Tests {
System.assertEquals(logEntryEvent.ParentLogTransactionId__c, log.ParentLogTransactionId__c, 'log.ParentLogTransactionId__c was not properly set');
System.assertEquals(logEntryEvent.ProfileId__c, log.ProfileId__c, 'log.ProfileId__c was not properly set');
System.assertEquals(logEntryEvent.ProfileName__c, log.ProfileName__c, 'log.ProfileName__c was not properly set');
- System.assertEquals(
- logEntryEvent.Scenario__c?.left(Schema.LoggerScenario__c.Name.getDescribe().getLength()),
- log.TransactionScenario__r?.Name,
- 'log.TransactionScenario__c was not properly set'
- );
- System.assertEquals(logEntryEvent.Scenario__c, log.TransactionScenario__r.UniqueId__c, 'log.TransactionScenario__r.UniqueId__c was not properly set');
System.assertEquals(logEntryEvent.SessionId__c, log.SessionId__c, 'log.SessionId__c was not properly set');
System.assertEquals(logEntryEvent.SessionId__c, log.SessionId__c, 'log.SessionId__c was not properly set');
System.assertEquals(logEntryEvent.SessionSecurityLevel__c, log.SessionSecurityLevel__c, 'log.SessionSecurityLevel__c was not properly set');
@@ -924,6 +1080,16 @@ private class LogEntryEventHandler_Tests {
System.assertEquals(logEntryEvent.TimeZoneId__c, log.TimeZoneId__c, 'log.TimeZoneId__c was not properly set');
System.assertEquals(logEntryEvent.TimeZoneName__c, log.TimeZoneName__c, 'log.TimeZoneName__c was not properly set');
System.assertEquals(logEntryEvent.TransactionId__c, log.TransactionId__c, 'log.TransactionId__c was not properly set');
+ System.assertEquals(
+ logEntryEvent.TransactionScenario__c?.left(Schema.LoggerScenario__c.Name.getDescribe().getLength()),
+ log.TransactionScenario__r?.Name,
+ 'log.TransactionScenario__c was not properly set'
+ );
+ System.assertEquals(
+ logEntryEvent.TransactionScenario__c,
+ log.TransactionScenario__r.UniqueId__c,
+ 'log.TransactionScenario__r.UniqueId__c was not properly set'
+ );
System.assertEquals(logEntryEvent.UserLoggingLevel__c, log.UserLoggingLevel__c, 'log.UserLoggingLevel__c was not properly set');
System.assertEquals(logEntryEvent.UserLoggingLevelOrdinal__c, log.UserLoggingLevelOrdinal__c, 'log.UserLoggingLevelOrdinal__c was not properly set');
// System.assertEquals(currentUser.UserRoleId, log.UserRoleId__c, 'log.UserRoleId__c was not properly set');
diff --git a/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls b/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls
index 112e0a7a3..db50fcda9 100644
--- a/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls
+++ b/nebula-logger/core/tests/log-management/classes/LogHandler_Tests.cls
@@ -283,15 +283,20 @@ private class LogHandler_Tests {
Date expectedRetentionDate = System.today().addDays(daysToRetainLog);
Logger.getUserSettings().DefaultNumberOfDaysToRetainLogs__c = defaultDaysToRetainLog;
upsert Logger.getUserSettings();
- LogScenarioRule__mdt logScenarioRule = new LogScenarioRule__mdt(Scenario__c = 'some scenario', NumberOfDaysToRetainLogs__c = daysToRetainLog);
- LoggerTestConfigurator.setMock(logScenarioRule);
- LoggerScenario__c logScenario = (LoggerScenario__c) LoggerMockDataCreator.createDataBuilder(Schema.LoggerScenario__c.SObjectType)
+ LoggerScenarioRule__mdt mockScenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsLogRetentionOverrideEnabled__c = String.valueOf(true),
+ Scenario__c = 'some scenario',
+ NumberOfDaysToRetainLogs__c = daysToRetainLog
+ );
+ LoggerTestConfigurator.setMock(mockScenarioRule);
+ LoggerScenario__c loggerScenario = (LoggerScenario__c) LoggerMockDataCreator.createDataBuilder(Schema.LoggerScenario__c.SObjectType)
.populateRequiredFields()
.getRecord();
- logScenario.UniqueId__c = logScenarioRule.Scenario__c;
- LoggerDataStore.getDatabase().insertRecord(logScenario);
+ loggerScenario.UniqueId__c = mockScenarioRule.Scenario__c;
+ LoggerDataStore.getDatabase().insertRecord(loggerScenario);
Log__c log = (Log__c) LoggerMockDataCreator.createDataBuilder(Schema.Log__c.SObjectType).populateRequiredFields().getRecord();
- log.TransactionScenario__c = logScenario.Id;
+ log.TransactionScenario__c = loggerScenario.Id;
LoggerDataStore.getDatabase().insertRecord(log);
diff --git a/nebula-logger/core/tests/log-management/utilities/LoggerTestConfigurator.cls b/nebula-logger/core/tests/log-management/utilities/LoggerTestConfigurator.cls
index 5ab9d46f1..57f532242 100644
--- a/nebula-logger/core/tests/log-management/utilities/LoggerTestConfigurator.cls
+++ b/nebula-logger/core/tests/log-management/utilities/LoggerTestConfigurator.cls
@@ -97,12 +97,11 @@ public without sharing class LoggerTestConfigurator {
}
/**
- * @description Loads the mock `LogScenarioRule__mdt` during test execution
- * @param mock The mock instance of `LogScenarioRule__mdt` to load
+ * @description Loads the mock `LoggerScenarioRule__mdt` during test execution
+ * @param mock The mock instance of `LoggerScenarioRule__mdt` to load
*/
- public static void setMock(LogScenarioRule__mdt mock) {
- Logger.setMockScenarioRule(mock);
- LogHandler.setMockScenarioRule(mock);
+ public static void setMock(LoggerScenarioRule__mdt mock) {
+ LoggerScenarioRule.setMock(mock);
}
/**
diff --git a/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls
index 41bb75345..254978c33 100644
--- a/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls
+++ b/nebula-logger/core/tests/logger-engine/classes/ComponentLogger_Tests.cls
@@ -205,7 +205,8 @@ private class ComponentLogger_Tests {
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
LogEntryEvent__e publishedLogEntryEvent = (LogEntryEvent__e) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().get(0);
System.assertEquals('Component', publishedLogEntryEvent.OriginType__c);
- System.assertEquals(componentLogEntry.scenario, publishedLogEntryEvent.Scenario__c);
+ System.assertEquals(componentLogEntry.scenario, publishedLogEntryEvent.TransactionScenario__c);
+ System.assertEquals(componentLogEntry.scenario, publishedLogEntryEvent.EntryScenario__c);
}
@IsTest
diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls
index 704dd6134..a33546aea 100644
--- a/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls
+++ b/nebula-logger/core/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls
@@ -250,7 +250,8 @@ private class FlowCollectionLogEntry_Tests {
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishCallCount());
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
LogEntryEvent__e publishedLogEntryEvent = (LogEntryEvent__e) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().get(0);
- System.assertEquals(flowCollectionEntry.scenario, publishedLogEntryEvent.Scenario__c);
+ System.assertEquals(flowCollectionEntry.scenario, publishedLogEntryEvent.TransactionScenario__c);
+ System.assertEquals(flowCollectionEntry.scenario, publishedLogEntryEvent.EntryScenario__c);
}
@IsTest
diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls
index 69374d4bb..b179fb092 100644
--- a/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls
+++ b/nebula-logger/core/tests/logger-engine/classes/FlowLogEntry_Tests.cls
@@ -207,7 +207,8 @@ private class FlowLogEntry_Tests {
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishCallCount());
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
LogEntryEvent__e publishedLogEntryEvent = (LogEntryEvent__e) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().get(0);
- System.assertEquals(flowEntry.scenario, publishedLogEntryEvent.Scenario__c);
+ System.assertEquals(flowEntry.scenario, publishedLogEntryEvent.TransactionScenario__c);
+ System.assertEquals(flowEntry.scenario, publishedLogEntryEvent.EntryScenario__c);
}
@IsTest
diff --git a/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls
index 8a92dde1e..f4e16709f 100644
--- a/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls
+++ b/nebula-logger/core/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls
@@ -247,7 +247,8 @@ private class FlowRecordLogEntry_Tests {
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishCallCount());
System.assertEquals(1, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
LogEntryEvent__e publishedLogEntryEvent = (LogEntryEvent__e) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().get(0);
- System.assertEquals(flowRecordEntry.scenario, publishedLogEntryEvent.Scenario__c);
+ System.assertEquals(flowRecordEntry.scenario, publishedLogEntryEvent.TransactionScenario__c);
+ System.assertEquals(flowRecordEntry.scenario, publishedLogEntryEvent.EntryScenario__c);
}
@IsTest
diff --git a/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls
index a46e706d3..d66f42889 100644
--- a/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls
+++ b/nebula-logger/core/tests/logger-engine/classes/Logger_Tests.cls
@@ -144,7 +144,7 @@ private class Logger_Tests {
static void it_should_set_scenario_when_default_scenario_configured() {
String mockScenario = 'some test scenario for this transaction';
LoggerSettings__c userSettings = LoggerSettings__c.getInstance();
- userSettings.DefaultLogScenario__c = mockScenario;
+ userSettings.DefaultScenario__c = mockScenario;
upsert userSettings;
String currentScenario = Logger.getScenario();
@@ -152,7 +152,7 @@ private class Logger_Tests {
System.assertEquals(
mockScenario,
currentScenario,
- 'The value of LoggerSettings__c.DefaultLogScenario__c should have been used as the current transaction scenario'
+ 'The value of LoggerSettings__c.DefaultScenario__c should have been used as the current transaction scenario'
);
}
@@ -166,27 +166,133 @@ private class Logger_Tests {
}
@IsTest
- static void it_should_use_the_first_specified_scenario_when_parameter_is_true() {
+ static void it_should_use_the_first_specified_scenario_as_transaction_scenario_when_parameter_is_true() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
LoggerParameter.setMock(new LoggerParameter__mdt(DeveloperName = 'UseFirstSpecifiedScenario', Value__c = String.valueOf(true)));
String firstMockScenario = 'the first test scenario specified for this transaction';
String secondMockScenario = 'the second test scenario specified for this transaction';
Logger.setScenario(firstMockScenario);
+ Logger.info('hello');
Logger.setScenario(secondMockScenario);
+ Logger.info('world');
+ Logger.saveLog();
- System.assertEquals(firstMockScenario, Logger.getScenario(), 'The first specified scenario should have been used');
+ System.assertEquals(2, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
+ for (LogEntryEvent__e logEntryEvent : (List) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents()) {
+ System.assertEquals(firstMockScenario, logEntryEvent.TransactionScenario__c);
+ }
}
@IsTest
- static void it_should_use_the_last_specified_scenario_when_parameter_is_false() {
+ static void it_should_use_the_last_specified_scenario_as_transaction_scenario_when_parameter_is_false() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
LoggerParameter.setMock(new LoggerParameter__mdt(DeveloperName = 'UseFirstSpecifiedScenario', Value__c = String.valueOf(false)));
String firstMockScenario = 'the first test scenario specified for this transaction';
String secondMockScenario = 'the second test scenario specified for this transaction';
Logger.setScenario(firstMockScenario);
+ Logger.info('hello');
+ Logger.setScenario(secondMockScenario);
+ Logger.info('world');
+ Logger.saveLog();
+
+ System.assertEquals(2, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
+ for (LogEntryEvent__e logEntryEvent : (List) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents()) {
+ System.assertEquals(secondMockScenario, logEntryEvent.TransactionScenario__c, 'The last specified scenario should have been used');
+ }
+ }
+
+ @IsTest
+ static void it_should_set_transaction_scenario_and_entry_scenario_for_published_log_entry_events() {
+ LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
+ String firstMockScenario = 'the first test scenario specified for this transaction';
+ String secondMockScenario = 'the second test scenario specified for this transaction';
+
+ Logger.setScenario(firstMockScenario);
+ Logger.info('hello');
Logger.setScenario(secondMockScenario);
+ Logger.info('world');
+ Logger.saveLog();
- System.assertEquals(secondMockScenario, Logger.getScenario(), 'The last specified scenario should have been used');
+ System.assertEquals(2, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
+ List publishedLogEntryEvents = (List) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents();
+ LogEntryEvent__e firstLogEntryEvent = publishedLogEntryEvents.get(0);
+ System.assertEquals(firstMockScenario, firstLogEntryEvent.EntryScenario__c);
+ System.assertEquals(firstMockScenario, firstLogEntryEvent.TransactionScenario__c);
+ LogEntryEvent__e secondLogEntryEvent = publishedLogEntryEvents.get(1);
+ System.assertEquals(secondMockScenario, secondLogEntryEvent.EntryScenario__c);
+ System.assertEquals(firstMockScenario, secondLogEntryEvent.TransactionScenario__c);
+ }
+
+ @IsTest
+ static void it_should_end_scenario_when_no_scenario_was_previously_set() {
+ System.assertEquals(null, Logger.getScenario());
+
+ Logger.endScenario('some scenario that was never set');
+
+ System.assertEquals(null, Logger.getScenario());
+ }
+
+ @IsTest
+ static void it_should_end_scenario_when_specified_scenario_matches() {
+ System.assertEquals(null, Logger.getScenario());
+ String mockScenario = 'some test scenario for this transaction';
+ Logger.setScenario(mockScenario);
+ System.assertEquals(mockScenario, Logger.getScenario(), 'The mock scenario should have been set as the current scenario');
+
+ Logger.endScenario(mockScenario);
+
+ System.assertEquals(null, Logger.getScenario(), 'The mock scenario should have been cleared');
+ }
+
+ @IsTest
+ static void it_should_revert_to_previous_scenario_when_current_scenario_is_ended() {
+ System.assertEquals(null, Logger.getScenario());
+ String firstMockScenario = 'some test scenario ';
+ Logger.setScenario(firstMockScenario);
+ System.assertEquals(firstMockScenario, Logger.getScenario());
+ String secondMockScenario = 'another test scenario ';
+ Logger.setScenario(secondMockScenario);
+ System.assertEquals(secondMockScenario, Logger.getScenario());
+
+ Logger.endScenario(secondMockScenario);
+
+ System.assertEquals(firstMockScenario, Logger.getScenario(), 'The scenario should have reverted to the first scenario');
+ }
+
+ @IsTest
+ static void it_should_revert_to_previous_scenario_rule_when_current_scenario_is_ended() {
+ LoggingLevel originalLoggingLevel = Logger.getUserLoggingLevel();
+ System.assertEquals(null, Logger.getScenario());
+ String firstMockScenario = 'some test scenario ';
+ LoggerScenarioRule__mdt firstMockScenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ Scenario__c = firstMockScenario,
+ UserLoggingLevel__c = LoggingLevel.ERROR.name()
+ );
+ LoggerScenarioRule.setMock(firstMockScenarioRule);
+ System.assertNotEquals(originalLoggingLevel.name(), firstMockScenarioRule.UserLoggingLevel__c);
+ Logger.setScenario(firstMockScenario);
+ System.assertEquals(firstMockScenario, Logger.getScenario());
+ String secondMockScenario = 'another test scenario ';
+ LoggerScenarioRule__mdt secondMockScenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ Scenario__c = secondMockScenario,
+ UserLoggingLevel__c = LoggingLevel.WARN.name()
+ );
+ LoggerScenarioRule.setMock(secondMockScenarioRule);
+ System.assertNotEquals(firstMockScenarioRule.UserLoggingLevel__c, secondMockScenarioRule.UserLoggingLevel__c);
+ Logger.setScenario(secondMockScenario);
+ System.assertEquals(secondMockScenario, Logger.getScenario());
+ System.assertEquals(secondMockScenarioRule.UserLoggingLevel__c, Logger.getUserLoggingLevel().name());
+
+ Logger.endScenario(secondMockScenario);
+
+ System.assertEquals(firstMockScenario, Logger.getScenario(), 'The scenario should have reverted to the first scenario');
+ System.assertEquals(firstMockScenarioRule, LoggerScenarioRule.getInstance(firstMockScenario));
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(secondMockScenario));
+ System.assertEquals(firstMockScenarioRule.UserLoggingLevel__c, Logger.getUserLoggingLevel().name());
}
@IsTest
@@ -225,32 +331,152 @@ private class Logger_Tests {
}
@IsTest
- static void it_should_apply_scenario_rule_logging_level_when_scenario_is_set() {
- String mockScenario = 'some test scenario for this transaction';
- LogScenarioRule__mdt scenarioRule = new LogScenarioRule__mdt(Scenario__c = mockScenario, UserLoggingLevel__c = LoggingLevel.FINER.name());
- Logger.setMockScenarioRule(scenarioRule);
- Logger.getUserSettings().LoggingLevel__c = LoggingLevel.ERROR.name();
- System.assertNotEquals(scenarioRule.UserLoggingLevel__c, Logger.getUserSettings().LoggingLevel__c);
+ static void it_should_override_logger_is_enabled_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsLoggerEnabled__c = String.valueOf(!Logger.getUserSettings().IsEnabled__c),
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsLoggerEnabled__c), Logger.getUserSettings().IsEnabled__c);
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsLoggerEnabled__c), Logger.isEnabled());
- Logger.setScenario(mockScenario);
+ Logger.setScenario(scenarioRule.Scenario__c);
- System.assertEquals(scenarioRule.UserLoggingLevel__c, Logger.getUserSettings().LoggingLevel__c);
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsLoggerEnabled__c), Logger.getUserSettings().IsEnabled__c);
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsLoggerEnabled__c), Logger.isEnabled());
}
@IsTest
- static void it_should_set_scenario_when_platform_events_are_published() {
- LoggerDataStore.setMock(LoggerMockDataStore.getEventBus());
- String mockScenario = 'some test scenario for this transaction';
+ static void it_should_override_anonymous_mode_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsAnonymousModeEnabled__c = String.valueOf(!Logger.getUserSettings().IsAnonymousModeEnabled__c),
+ IsEnabled__c = true,
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsAnonymousModeEnabled__c), Logger.getUserSettings().IsAnonymousModeEnabled__c);
- Logger.info('hello');
- Logger.setScenario(mockScenario);
- Logger.info('world');
- Logger.saveLog();
+ Logger.setScenario(scenarioRule.Scenario__c);
- System.assertEquals(2, LoggerMockDataStore.getEventBus().getPublishedPlatformEvents().size());
- for (LogEntryEvent__e logEntryEvent : (List) LoggerMockDataStore.getEventBus().getPublishedPlatformEvents()) {
- System.assertEquals(mockScenario, logEntryEvent.Scenario__c);
- }
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsAnonymousModeEnabled__c), Logger.getUserSettings().IsAnonymousModeEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_apex_system_debugging_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsApexSystemDebugLoggingEnabled__c = String.valueOf(!Logger.getUserSettings().IsApexSystemDebugLoggingEnabled__c),
+ IsEnabled__c = true,
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsApexSystemDebugLoggingEnabled__c), Logger.getUserSettings().IsApexSystemDebugLoggingEnabled__c);
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsApexSystemDebugLoggingEnabled__c), Logger.getUserSettings().IsApexSystemDebugLoggingEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_data_masking_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsDataMaskingEnabled__c = String.valueOf(!Logger.getUserSettings().IsDataMaskingEnabled__c),
+ IsEnabled__c = true,
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsDataMaskingEnabled__c), Logger.getUserSettings().IsDataMaskingEnabled__c);
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsDataMaskingEnabled__c), Logger.getUserSettings().IsDataMaskingEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_javascript_console_logging_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsJavaScriptConsoleLoggingEnabled__c = String.valueOf(!Logger.getUserSettings().IsJavaScriptConsoleLoggingEnabled__c),
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(
+ Boolean.valueOf(scenarioRule.IsJavaScriptConsoleLoggingEnabled__c),
+ Logger.getUserSettings().IsJavaScriptConsoleLoggingEnabled__c
+ );
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsJavaScriptConsoleLoggingEnabled__c), Logger.getUserSettings().IsJavaScriptConsoleLoggingEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_record_field_stripping_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsRecordFieldStrippingEnabled__c = String.valueOf(!Logger.getUserSettings().IsRecordFieldStrippingEnabled__c),
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsRecordFieldStrippingEnabled__c), Logger.getUserSettings().IsRecordFieldStrippingEnabled__c);
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsRecordFieldStrippingEnabled__c), Logger.getUserSettings().IsRecordFieldStrippingEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_saving_enabled_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ IsSavingEnabled__c = String.valueOf(!Logger.getUserSettings().IsSavingEnabled__c),
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(Boolean.valueOf(scenarioRule.IsSavingEnabled__c), Logger.getUserSettings().IsSavingEnabled__c);
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(Boolean.valueOf(scenarioRule.IsSavingEnabled__c), Logger.getUserSettings().IsSavingEnabled__c);
+ }
+
+ @IsTest
+ static void it_should_override_save_method_setting_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ SaveMethod__c = Logger.SaveMethod.QUEUEABLE.name(),
+ Scenario__c = 'Some scenario'
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ System.assertNotEquals(null, LoggerScenarioRule.getInstance(scenarioRule.Scenario__c));
+ System.assertNotEquals(scenarioRule.SaveMethod__c, Logger.getSaveMethod().name());
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(scenarioRule.SaveMethod__c, Logger.getSaveMethod().name());
+ }
+
+ @IsTest
+ static void it_should_override_user_logging_level_when_matching_logger_scenario_rule_is_configured() {
+ LoggerScenarioRule__mdt scenarioRule = new LoggerScenarioRule__mdt(
+ IsEnabled__c = true,
+ Scenario__c = 'Some scenario',
+ UserLoggingLevel__c = LoggingLevel.FINER.name()
+ );
+ LoggerScenarioRule.setMock(scenarioRule);
+ Logger.getUserSettings().LoggingLevel__c = LoggingLevel.ERROR.name();
+ System.assertNotEquals(scenarioRule.UserLoggingLevel__c, Logger.getUserSettings().LoggingLevel__c);
+
+ Logger.setScenario(scenarioRule.Scenario__c);
+
+ System.assertEquals(scenarioRule.UserLoggingLevel__c, Logger.getUserSettings().LoggingLevel__c);
}
@IsTest
@@ -5960,7 +6186,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, deleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -5978,7 +6204,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, deleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -5995,7 +6221,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, deleteResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(logMessage.getMessage(), returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6017,7 +6243,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, deleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6035,7 +6261,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, deleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6052,7 +6278,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, deleteResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(message, returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6074,7 +6300,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, mergeResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6092,7 +6318,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, mergeResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6109,7 +6335,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, mergeResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(logMessage.getMessage(), returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6131,7 +6357,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, mergeResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6149,7 +6375,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, mergeResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6166,7 +6392,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, mergeResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(message, returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6188,7 +6414,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, saveResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6206,7 +6432,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, saveResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6223,7 +6449,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, saveResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(logMessage.getMessage(), returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6245,7 +6471,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, saveResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6263,7 +6489,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, saveResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6280,7 +6506,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, saveResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(message, returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6302,7 +6528,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, upsertResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6320,7 +6546,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, upsertResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6337,7 +6563,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, upsertResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(logMessage.getMessage(), returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6359,7 +6585,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, upsertResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6377,7 +6603,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, upsertResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6394,7 +6620,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, upsertResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(message, returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6416,7 +6642,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, undeleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6434,7 +6660,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, undeleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6451,7 +6677,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, logMessage, undeleteResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(logMessage.getMessage(), returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
@@ -6473,7 +6699,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, undeleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6491,7 +6717,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, undeleteResults);
System.assertEquals(0, Logger.getBufferSize());
- System.assertEquals(null, returnedBuilder);
+ System.assertEquals(false, returnedBuilder.shouldSave());
}
@IsTest
@@ -6508,7 +6734,7 @@ private class Logger_Tests {
LogEntryEventBuilder returnedBuilder = Logger.logDatabaseErrors(logEntryLevel, message, undeleteResults);
System.assertEquals(1, Logger.getBufferSize());
- System.assertNotEquals(null, returnedBuilder);
+ System.assertEquals(true, returnedBuilder.shouldSave());
System.assertEquals(message, returnedBuilder.getLogEntryEvent().Message__c);
System.assertEquals(1, returnedBuilder.getLogEntryEvent().DatabaseResultCollectionSize__c);
String expectedDatabaseResultJson = JSON.serializePretty(new List{ unsuccessfulResult });
diff --git a/nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml b/nebula-logger/managed-package/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml
similarity index 86%
rename from nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml
rename to nebula-logger/managed-package/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml
index 5c47d995c..ed172c3cc 100644
--- a/nebula-logger/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml
+++ b/nebula-logger/managed-package/core/main/configuration/objects/LoggerSettings__c/fields/DefaultLogScenario__c.field-meta.xml
@@ -1,12 +1,12 @@
DefaultLogScenario__c
- Active
+ DeprecateCandidate
CCPA;GDPR;PII
Sets a default scenario for the transaction
false
Sets a default scenario for the transaction
-
+
255
false
Confidential
diff --git a/nebula-logger/core/main/configuration/layouts/LogScenarioRule__mdt-Log Scenario Rule Layout.layout-meta.xml b/nebula-logger/managed-package/core/main/deprecated/layouts/LogScenarioRule__mdt-Log Scenario Rule Layout.layout-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/layouts/LogScenarioRule__mdt-Log Scenario Rule Layout.layout-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/layouts/LogScenarioRule__mdt-Log Scenario Rule Layout.layout-meta.xml
diff --git a/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml
new file mode 100644
index 000000000..80aa154a8
--- /dev/null
+++ b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/LogScenarioRule__mdt.object-meta.xml
@@ -0,0 +1,6 @@
+
+
+
+ OLD: Log Scenario Rules
+ Public
+
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/IsEnabled__c.field-meta.xml
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/NumberOfDaysToRetainLogs__c.field-meta.xml
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/Scenario__c.field-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/Scenario__c.field-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/Scenario__c.field-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/Scenario__c.field-meta.xml
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/fields/UserLoggingLevel__c.field-meta.xml
diff --git a/nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/listViews/All.listView-meta.xml b/nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/listViews/All.listView-meta.xml
similarity index 100%
rename from nebula-logger/core/main/configuration/objects/LogScenarioRule__mdt/listViews/All.listView-meta.xml
rename to nebula-logger/managed-package/core/main/deprecated/objects/LogScenarioRule__mdt/listViews/All.listView-meta.xml
diff --git a/nebula-logger/managed-package/sfdx-project.json b/nebula-logger/managed-package/sfdx-project.json
index 4eacfb29a..30e798114 100644
--- a/nebula-logger/managed-package/sfdx-project.json
+++ b/nebula-logger/managed-package/sfdx-project.json
@@ -18,13 +18,13 @@
],
"packageAliases": {
"Nebula Logger - Managed Package": "0Ho5Y000000XZCDSA4",
- "Nebula Logger - Managed Package@4.0.0-9-managed-package-release": "04t5Y000000XJZ7QAO",
- "Nebula Logger - Managed Package@4.2.0-0-more-fields-and-methods": "04t5Y000000Xg4wQAC",
- "Nebula Logger - Managed Package@4.3.0-3-logger-console-app": "04t5Y000000YLDLQA4",
- "Nebula Logger - Managed Package@4.4.0-2-configurable-default-save-method": "04t5Y0000027FFgQAM",
- "Nebula Logger - Managed Package@4.5.0-0-logger-plugin-framework": "04t5Y0000027FMhQAM",
- "Nebula Logger - Managed Package@4.6.0-0-tagging-system-overhaul": "04t5Y0000015keOQAQ",
- "Nebula Logger - Managed Package@4.7.0-30-spring-22-release": "04t5Y0000015lXNQAY",
- "Nebula Logger - Managed Package@4.8.0-9-summer-22-release": "04t5Y0000015lsgQAA"
+ "Nebula Logger - Managed Package@4.0.0-managed-package-release": "04t5Y000000XJZ7QAO",
+ "Nebula Logger - Managed Package@4.2.0-more-fields-and-methods": "04t5Y000000Xg4wQAC",
+ "Nebula Logger - Managed Package@4.3.0-logger-console-app": "04t5Y000000YLDLQA4",
+ "Nebula Logger - Managed Package@4.4.0-configurable-default-save-method": "04t5Y0000027FFgQAM",
+ "Nebula Logger - Managed Package@4.5.0-logger-plugin-framework": "04t5Y0000027FMhQAM",
+ "Nebula Logger - Managed Package@4.6.0-tagging-system-overhaul": "04t5Y0000015keOQAQ",
+ "Nebula Logger - Managed Package@4.7.0-spring-22-release": "04t5Y0000015lXNQAY",
+ "Nebula Logger - Managed Package@4.8.0-summer-22-release": "04t5Y0000015lsgQAA"
}
}
diff --git a/nebula-logger/plugins/slack/README.md b/nebula-logger/plugins/slack/README.md
index ea29601d7..156504705 100644
--- a/nebula-logger/plugins/slack/README.md
+++ b/nebula-logger/plugins/slack/README.md
@@ -2,8 +2,8 @@
> :information_source: This plugin requires `v4.7.1` or newer of Nebula Logger's unlocked package
-[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgQQAQ)
-[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lgQQAQ)
+[![Install Unlocked Package Plugin in a Sandbox](../.images/btn-install-unlocked-package-plugin-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lvVQAQ)
+[![Install Unlocked Package Plugin in Production](../.images/btn-install-unlocked-package-plugin-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015lvVQAQ)
Adds a Slack integration for the unlocked package edition of Nebula Logger. Any logs with log entries that meet a certain (configurable) logging level will automatically be posted to your Slack channel via an asynchronous `Queueable` job.
diff --git a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls
index 64b7ca3ad..d944c73ea 100644
--- a/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls
+++ b/nebula-logger/plugins/slack/plugin/slack/classes/SlackLoggerPlugin.cls
@@ -202,14 +202,14 @@ public without sharing class SlackLoggerPlugin implements LoggerPlugin.Triggerab
FieldDto exceptionStackTraceField = new FieldDto();
exceptionStackTraceField.isShort = false;
exceptionStackTraceField.title = Schema.LogEntry__c.ExceptionStackTrace__c.getDescribe().getLabel();
- exceptionStackTraceField.value = '`' + lastLogEntry.ExceptionStackTrace__c + '`';
+ exceptionStackTraceField.value = '```\n' + lastLogEntry.ExceptionStackTrace__c + '\n```';
notification.fields.add(exceptionStackTraceField);
}
FieldDto stackTraceField = new FieldDto();
stackTraceField.isShort = false;
stackTraceField.title = Schema.LogEntry__c.StackTrace__c.getDescribe().getLabel();
- stackTraceField.value = '`' + lastLogEntry.StackTrace__c + '`';
+ stackTraceField.value = '```\n' + lastLogEntry.StackTrace__c + '\n```';
notification.fields.add(stackTraceField);
// TODO: switch to dynamically creating Slack DTO fields based on a new `Log__c` field set parameter
diff --git a/nebula-logger/recipes/profiles/Admin.profile-meta.xml b/nebula-logger/recipes/profiles/Admin.profile-meta.xml
index abebffb2a..c57c323c4 100644
--- a/nebula-logger/recipes/profiles/Admin.profile-meta.xml
+++ b/nebula-logger/recipes/profiles/Admin.profile-meta.xml
@@ -1833,6 +1833,11 @@
LogEntry__c.DatabaseResultType__c
true
+
+ false
+ LogEntry__c.EntryScenario__c
+ true
+
false
LogEntry__c.EpochTimestamp__c
@@ -2410,12 +2415,12 @@
false
- LogScenarioRule__mdt.IsEnabled__c
+ LoggerScenarioRule__mdt.IsEnabled__c
true
false
- LogScenarioRule__mdt.NumberOfDaysToRetainLogs__c
+ LoggerScenarioRule__mdt.NumberOfDaysToRetainLogs__c
true
@@ -2967,7 +2972,7 @@
LogRetentionRule__mdt-Log Retention Rule Layout
- LogScenarioRule__mdt-Log Scenario Rule Layout
+ LoggerScenarioRule__mdt-Logger Scenario Rule Layout
LogStatus__mdt-Log Status Layout
diff --git a/package-lock.json b/package-lock.json
index 7e508eb95..8c8501d1f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "nebula-logger",
- "version": "4.8.0",
+ "version": "4.8.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -9860,8 +9860,7 @@
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
- "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
- "dev": true
+ "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"@sinonjs/commons": {
"version": "1.8.3",
@@ -9885,7 +9884,6 @@
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz",
"integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==",
- "dev": true,
"requires": {
"defer-to-connect": "^2.0.0"
}
@@ -9941,7 +9939,6 @@
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz",
"integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==",
- "dev": true,
"requires": {
"@types/http-cache-semantics": "*",
"@types/keyv": "*",
@@ -9988,8 +9985,7 @@
"@types/http-cache-semantics": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz",
- "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==",
- "dev": true
+ "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ=="
},
"@types/istanbul-lib-coverage": {
"version": "2.0.4",
@@ -10057,8 +10053,7 @@
"@types/json-buffer": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz",
- "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==",
- "dev": true
+ "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ=="
},
"@types/json-schema": {
"version": "7.0.11",
@@ -10076,7 +10071,6 @@
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
"integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==",
- "dev": true,
"requires": {
"@types/node": "*"
}
@@ -10127,8 +10121,7 @@
"@types/node": {
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.0.tgz",
- "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==",
- "dev": true
+ "integrity": "sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA=="
},
"@types/normalize-package-data": {
"version": "2.4.1",
@@ -10152,7 +10145,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz",
"integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==",
- "dev": true,
"requires": {
"@types/node": "*"
}
@@ -11282,14 +11274,12 @@
"cacheable-lookup": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz",
- "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==",
- "dev": true
+ "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA=="
},
"cacheable-request": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz",
"integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==",
- "dev": true,
"requires": {
"clone-response": "^1.0.2",
"get-stream": "^5.1.0",
@@ -11304,7 +11294,6 @@
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
"integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
- "dev": true,
"requires": {
"pump": "^3.0.0"
}
@@ -11750,7 +11739,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
"integrity": "sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==",
- "dev": true,
"requires": {
"mimic-response": "^1.0.0"
}
@@ -12018,7 +12006,6 @@
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.8.tgz",
"integrity": "sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==",
- "dev": true,
"requires": {
"@types/json-buffer": "~3.0.0",
"json-buffer": "~3.0.1"
@@ -12365,8 +12352,7 @@
"defer-to-connect": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",
- "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==",
- "dev": true
+ "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
},
"define-lazy-prop": {
"version": "2.0.0",
@@ -12720,7 +12706,6 @@
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
- "dev": true,
"requires": {
"once": "^1.4.0"
}
@@ -14439,7 +14424,6 @@
"version": "11.8.5",
"resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz",
"integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==",
- "dev": true,
"requires": {
"@sindresorhus/is": "^4.0.0",
"@szmarczak/http-timer": "^4.0.5",
@@ -14877,8 +14861,7 @@
"http-cache-semantics": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
- "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
- "dev": true
+ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ=="
},
"http-call": {
"version": "5.3.0",
@@ -14947,7 +14930,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz",
"integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==",
- "dev": true,
"requires": {
"quick-lru": "^5.1.1",
"resolve-alpn": "^1.0.0"
@@ -17356,8 +17338,7 @@
"json-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
},
"json-parse-better-errors": {
"version": "1.0.2",
@@ -17502,7 +17483,6 @@
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.3.0.tgz",
"integrity": "sha512-C30Un9+63J0CsR7Wka5quXKqYZsT6dcRQ2aOwGcSc3RiQ4HGWpTAHlCA+puNfw2jA/s11EsxA1nCXgZRuRKMQQ==",
- "dev": true,
"requires": {
"compress-brotli": "^1.3.8",
"json-buffer": "3.0.1"
@@ -18174,8 +18154,7 @@
"lowercase-keys": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
- "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==",
- "dev": true
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
},
"lru-cache": {
"version": "6.0.0",
@@ -18470,8 +18449,7 @@
"mimic-response": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
- "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
- "dev": true
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
},
"minimatch": {
"version": "3.0.4",
@@ -18738,10 +18716,9 @@
"dev": true
},
"moment": {
- "version": "2.29.3",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
- "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==",
- "dev": true
+ "version": "2.29.4",
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
+ "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"ms": {
"version": "2.1.2",
@@ -19154,8 +19131,7 @@
"normalize-url": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
- "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==",
- "dev": true
+ "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A=="
},
"npm": {
"version": "8.12.2",
@@ -21462,8 +21438,7 @@
"p-cancelable": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz",
- "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==",
- "dev": true
+ "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg=="
},
"p-finally": {
"version": "1.0.0",
@@ -22153,7 +22128,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
- "dev": true,
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
@@ -22200,8 +22174,7 @@
"quick-lru": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz",
- "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==",
- "dev": true
+ "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA=="
},
"raw-body": {
"version": "2.5.1",
@@ -22770,8 +22743,7 @@
"resolve-alpn": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz",
- "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==",
- "dev": true
+ "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g=="
},
"resolve-cwd": {
"version": "3.0.0",
@@ -22798,7 +22770,6 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz",
"integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==",
- "dev": true,
"requires": {
"lowercase-keys": "^2.0.0"
}
diff --git a/package.json b/package.json
index a09b6e6be..f9ac8af0d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nebula-logger",
- "version": "4.8.1",
+ "version": "4.8.2",
"description": "Designed for Salesforce admins, developers & architects. A robust logger for Apex, Flow, Process Builder & Integrations.",
"author": "Jonathan Gillespie",
"license": "MIT",
@@ -89,9 +89,11 @@
"ejs": ">=3.1.7",
"follow-redirects": ">=1.14.8",
"glob-parent": ">=5.1.2",
+ "got": ">=11.8.5",
"json-schema": ">=0.4.0",
"markdown-it": ">=12.3.2",
"marked": ">=4.0.10",
+ "moment": ">=2.29.4",
"nanoid": ">=3.1.31",
"shelljs": ">=0.8.5",
"simple-get": ">=4.0.1"
diff --git a/scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex b/scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex
index a9f2defe5..31fd49f4c 100644
--- a/scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex
+++ b/scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex
@@ -10,13 +10,13 @@ if (countOfRecordsToUpdate == 0) {
System.debug(countOfRecordsToUpdate + ' Log__c records have legacy field Scenario__c set but not LoggerScenario__c');
-Map scenarioNameToLogScenario = new Map();
+Map scenarioNameToLoggerScenario = new Map();
List logsToUpdate = [SELECT Id, TransactionScenario__c, Scenario__c FROM Log__c WHERE TransactionScenario__c = null AND Scenario__c != null LIMIT :Limits.getLimitDmlRows()];
for (Log__c log : logsToUpdate) {
- scenarioNameToLogScenario.put(log.TransactionScenario__r.UniqueId__c, log.TransactionScenario__r.clone());
log.TransactionScenario__r = new LoggerScenario__c(UniqueId__c = log.Scenario__c);
+ scenarioNameToLoggerScenario.put(log.Scenario__c, log.TransactionScenario__r.clone());
}
-upsert scenarioNameToLogScenario.values() UniqueId__c;
+upsert scenarioNameToLoggerScenario.values() UniqueId__c;
update logsToUpdate;
countOfRecordsToUpdate = [SELECT COUNT() FROM Log__c WHERE TransactionScenario__c = null AND Scenario__c != null];
diff --git a/sfdx-project.json b/sfdx-project.json
index e14f61c78..2416b33ea 100644
--- a/sfdx-project.json
+++ b/sfdx-project.json
@@ -12,9 +12,9 @@
"package": "Nebula Logger - Core",
"path": "./nebula-logger/core",
"definitionFile": "./config/scratch-orgs/base-scratch-def.json",
- "versionNumber": "4.8.1.NEXT",
- "versionName": "New Logger Scenario Custom Object",
- "versionDescription": "Added new custom object LoggerScenario__c to provide a more robust way to manage data related to scenario-based logging",
+ "versionNumber": "4.8.2.NEXT",
+ "versionName": "More Controls for Scenario-Based Logging",
+ "versionDescription": "Replaced LogScenarioRule__mdt with an enhanced object LoggerScenarioRule__mdt & added new method Logger.endScenario() to provide more control for scenario-based logging",
"releaseNotesUrl": "https://github.com/jongpie/NebulaLogger/releases",
"default": true
},
@@ -24,7 +24,7 @@
"path": "./nebula-logger/plugins/async-failure-additions/plugin",
"dependencies": [
{
- "package": "Nebula Logger - Core@4.7.2-1-parent-log-transaction-id-bugfix"
+ "package": "Nebula Logger - Core@4.7.2-parent-log-transaction-id-bugfix"
}
],
"versionName": "Added missing CMDT file LoggerSObjectHandler.BatchApexErrorEvent",
@@ -36,7 +36,7 @@
"path": "./nebula-logger/plugins/big-object-archiving/plugin",
"dependencies": [
{
- "package": "Nebula Logger - Core@4.7.1-8-plugin-framework-overhaul"
+ "package": "Nebula Logger - Core@4.7.1-plugin-framework-overhaul"
}
],
"versionName": "Beta Release",
@@ -49,7 +49,7 @@
"path": "./nebula-logger/plugins/log-retention-rules/plugin",
"dependencies": [
{
- "package": "Nebula Logger - Core@4.7.1-8-plugin-framework-overhaul"
+ "package": "Nebula Logger - Core@4.7.1-plugin-framework-overhaul"
}
],
"versionName": "Beta Release",
@@ -62,7 +62,7 @@
"path": "./nebula-logger/plugins/logger-admin-dashboard/plugin",
"dependencies": [
{
- "package": "Nebula Logger - Core@4.6.12-0-log-scenario-rules"
+ "package": "Nebula Logger - Core@4.6.12-log-scenario-rules"
}
],
"versionName": "Beta Release",
@@ -75,12 +75,12 @@
"path": "./nebula-logger/plugins/slack/plugin",
"dependencies": [
{
- "package": "Nebula Logger - Core@4.7.1-8-plugin-framework-overhaul"
+ "package": "Nebula Logger - Core@4.7.1-plugin-framework-overhaul"
}
],
- "versionName": "Beta Release: Round 3",
- "versionNumber": "0.10.0.NEXT",
- "versionDescription": "Updated Slack plugin to work with Nebula Logger v4.7.1",
+ "versionName": "Improved formatting for stack traces",
+ "versionNumber": "1.5.0.NEXT",
+ "versionDescription": "Cleaned up formatting of stack trace fields to handle line breaks",
"default": false
},
{
@@ -94,56 +94,58 @@
],
"packageAliases": {
"Nebula Logger - Core": "0Ho5Y000000TNKASA4",
- "Nebula Logger - Core@4.4.1-3-unlocked-package-release": "04t5Y0000027FGFQA2",
- "Nebula Logger - Core@4.4.2-0-topics-overloads-cleanup": "04t5Y0000027FGeQAM",
- "Nebula Logger - Core@4.4.3-0-guest-user-bugfix": "04t5Y0000027FI1QAM",
- "Nebula Logger - Core@4.4.4-0-timestamp-bugfix": "04t5Y0000027FIQQA2",
- "Nebula Logger - Core@4.4.5-0-log-batch-purger-bugfixes": "04t5Y0000027FIVQA2",
- "Nebula Logger - Core@4.4.6-0-new-save-method-synchronous_dml": "04t5Y0000027FJdQAM",
- "Nebula Logger - Core@4.5.0-0-logger-plugin-framework": "04t5Y0000027FMrQAM",
- "Nebula Logger - Core@4.5.1-0-flow-collection-log-entry": "04t5Y0000027FN6QAM",
- "Nebula Logger - Core@4.5.2-0-plugin-framework-enhancements": "04t5Y0000027FNaQAM",
- "Nebula Logger - Core@4.6.0-0-tagging-system-overhaul": "04t5Y0000015keTQAQ",
- "Nebula Logger - Core@4.6.1-0-summer-21-upgrade": "04t5Y0000015kfMQAQ",
- "Nebula Logger - Core@4.6.2-0-anonymous-logs": "04t5Y0000015kgPQAQ",
- "Nebula Logger - Core@4.6.3-0-more-metadata-data": "04t5Y0000015kgeQAA",
- "Nebula Logger - Core@4.6.4-0-logger-for-lwc-and-aura": "04t5Y0000015kgjQAA",
- "Nebula Logger - Core@4.6.5-0-internal-trigger-handler-optimizations": "04t5Y0000015kh3QAA",
- "Nebula Logger - Core@4.6.6-0-configurable-apex-debug-log-syntax": "04t5Y0000015khXQAQ",
- "Nebula Logger - Core@4.6.7-0-security-enhancements": "04t5Y0000015klZQAQ",
- "Nebula Logger - Core@4.6.8-0-new-log-entry-event-stream-component": "04t5Y0000015kplQAA",
- "Nebula Logger - Core@4.6.9-0-custom-metadata-types-optimized": "04t5Y0000015kqtQAA",
- "Nebula Logger - Core@4.6.10-0-new-log-and-logger-settings-fields": "04t5Y0000015l27QAA",
- "Nebula Logger - Core@4.6.11-0-admin-enhancements---new-dashboard,-reports,-and-error-email-alerts": "04t5Y0000015l2qQAA",
- "Nebula Logger - Core@4.6.12-0-log-scenario-rules": "04t5Y0000015l3oQAA",
- "Nebula Logger - Core@4.6.13-0-save-method-support-for-flows-and-lightning-components": "04t5Y0000015l4cQAA",
- "Nebula Logger - Core@4.6.14-0-new-logger-settings-component": "04t5Y0000015lB0QAI",
- "Nebula Logger - Core@4.6.15-0-small-bugfixes-and-test-improvements": "04t5Y0000015lKDQAY",
- "Nebula Logger - Core@4.6.16-0-ui-cleanup": "04t5Y0000015lLzQAI",
- "Nebula Logger - Core@4.7.0-25-spring-'22-release": "04t5Y0000015lXSQAY",
- "Nebula Logger - Core@4.7.1-8-plugin-framework-overhaul": "04t5Y0000015lgBQAQ",
- "Nebula Logger - Core@4.7.2-1-parent-log-transaction-id-bugfix": "04t5Y0000015lhdQAA",
- "Nebula Logger - Core@4.7.3-2-query-selector-classes": "04t5Y0000015liHQAQ",
- "Nebula Logger - Core@4.7.4-3-new-method-logger.logdatabaseerrors()": "04t5Y0000015ligQAA",
- "Nebula Logger - Core@4.7.5-3-configurable-logger.setscenario()-behavior": "04t5Y0000015lkcQAA",
+ "Nebula Logger - Core@4.4.1-unlocked-package-release": "04t5Y0000027FGFQA2",
+ "Nebula Logger - Core@4.4.2-topics-overloads-cleanup": "04t5Y0000027FGeQAM",
+ "Nebula Logger - Core@4.4.3-guest-user-bugfix": "04t5Y0000027FI1QAM",
+ "Nebula Logger - Core@4.4.4-timestamp-bugfix": "04t5Y0000027FIQQA2",
+ "Nebula Logger - Core@4.4.5-log-batch-purger-bugfixes": "04t5Y0000027FIVQA2",
+ "Nebula Logger - Core@4.4.6-new-save-method-synchronous_dml": "04t5Y0000027FJdQAM",
+ "Nebula Logger - Core@4.5.0-logger-plugin-framework": "04t5Y0000027FMrQAM",
+ "Nebula Logger - Core@4.5.1-flow-collection-log-entry": "04t5Y0000027FN6QAM",
+ "Nebula Logger - Core@4.5.2-plugin-framework-enhancements": "04t5Y0000027FNaQAM",
+ "Nebula Logger - Core@4.6.0-tagging-system-overhaul": "04t5Y0000015keTQAQ",
+ "Nebula Logger - Core@4.6.1-summer-21-upgrade": "04t5Y0000015kfMQAQ",
+ "Nebula Logger - Core@4.6.2-anonymous-logs": "04t5Y0000015kgPQAQ",
+ "Nebula Logger - Core@4.6.3-more-metadata-data": "04t5Y0000015kgeQAA",
+ "Nebula Logger - Core@4.6.4-logger-for-lwc-and-aura": "04t5Y0000015kgjQAA",
+ "Nebula Logger - Core@4.6.5-internal-trigger-handler-optimizations": "04t5Y0000015kh3QAA",
+ "Nebula Logger - Core@4.6.6-configurable-apex-debug-log-syntax": "04t5Y0000015khXQAQ",
+ "Nebula Logger - Core@4.6.7-security-enhancements": "04t5Y0000015klZQAQ",
+ "Nebula Logger - Core@4.6.8-new-log-entry-event-stream-component": "04t5Y0000015kplQAA",
+ "Nebula Logger - Core@4.6.9-custom-metadata-types-optimized": "04t5Y0000015kqtQAA",
+ "Nebula Logger - Core@4.6.10-new-log-and-logger-settings-fields": "04t5Y0000015l27QAA",
+ "Nebula Logger - Core@4.6.11-admin-enhancements---new-dashboard,-reports,-and-error-email-alerts": "04t5Y0000015l2qQAA",
+ "Nebula Logger - Core@4.6.12-log-scenario-rules": "04t5Y0000015l3oQAA",
+ "Nebula Logger - Core@4.6.13-save-method-support-for-flows-and-lightning-components": "04t5Y0000015l4cQAA",
+ "Nebula Logger - Core@4.6.14-new-logger-settings-component": "04t5Y0000015lB0QAI",
+ "Nebula Logger - Core@4.6.15-small-bugfixes-and-test-improvements": "04t5Y0000015lKDQAY",
+ "Nebula Logger - Core@4.6.16-ui-cleanup": "04t5Y0000015lLzQAI",
+ "Nebula Logger - Core@4.7.0-spring-'22-release": "04t5Y0000015lXSQAY",
+ "Nebula Logger - Core@4.7.1-plugin-framework-overhaul": "04t5Y0000015lgBQAQ",
+ "Nebula Logger - Core@4.7.2-parent-log-transaction-id-bugfix": "04t5Y0000015lhdQAA",
+ "Nebula Logger - Core@4.7.3-query-selector-classes": "04t5Y0000015liHQAQ",
+ "Nebula Logger - Core@4.7.4-new-method-logger.logdatabaseerrors()": "04t5Y0000015ligQAA",
+ "Nebula Logger - Core@4.7.5-configurable-logger.setscenario()-behavior": "04t5Y0000015lkcQAA",
"Nebula Logger - Core@4.7.6-support-for-component-logging-of-apex-controller-errors": "04t5Y0000015lkmQAA",
"Nebula Logger - Core@4.7.7-bugfix-in-logger.setscenario()": "04t5Y0000015llLQAQ",
"Nebula Logger - Core@4.7.8-new-'batch-purge'-lwc": "04t5Y0000015lmOQAQ",
"Nebula Logger - Core@4.8.0-ignore-origin-method": "04t5Y0000015lslQAA",
"Nebula Logger - Core@4.8.1-new-logger-scenario-custom-object": "04t5Y0000015luIQAQ",
+ "Nebula Logger - Core@4.8.2-more-controls-for-scenario-based-logging": "04t5Y0000015lvuQAA",
"Nebula Logger - Plugin - Async Failure Additions": "0Ho5Y000000blO4SAI",
- "Nebula Logger - Plugin - Async Failure Additions@1.0.0-3": "04t5Y0000015lhiQAA",
- "Nebula Logger - Plugin - Async Failure Additions@1.0.1-1": "04t5Y0000015lhsQAA",
+ "Nebula Logger - Plugin - Async Failure Additions@1.0.0": "04t5Y0000015lhiQAA",
+ "Nebula Logger - Plugin - Async Failure Additions@1.0.1": "04t5Y0000015lhsQAA",
"Nebula Logger - Plugin - Big Object Archiving": "0Ho5Y000000blMSSAY",
- "Nebula Logger - Plugin - Big Object Archiving@0.9.0-2": "04t5Y0000015lgLQAQ",
+ "Nebula Logger - Plugin - Big Object Archiving@0.9.0": "04t5Y0000015lgLQAQ",
"Nebula Logger - Plugin - Log Retention Rules": "0Ho5Y000000blNfSAI",
- "Nebula Logger - Plugin - Log Retention Rules@0.9.0-2": "04t5Y0000015lgGQAQ",
+ "Nebula Logger - Plugin - Log Retention Rules@0.9.0": "04t5Y0000015lgGQAQ",
"Nebula Logger - Plugin - Logger Admin Dashboard": "0Ho5Y000000blNkSAI",
- "Nebula Logger - Plugin - Logger Admin Dashboard@0.9.0-0": "04t5Y0000015l3yQAA",
+ "Nebula Logger - Plugin - Logger Admin Dashboard@0.9.0": "04t5Y0000015l3yQAA",
"Nebula Logger - Plugin - Slack": "0Ho5Y000000blMDSAY",
- "Nebula Logger - Plugin - Slack@0.9.0-0-beta-release": "04t5e00000061lHAAQ",
- "Nebula Logger - Plugin - Slack@0.9.1-0-beta-release-round-2": "04t5e00000065xiAAA",
- "Nebula Logger - Plugin - Slack@0.9.2-0-beta-release-round-3": "04t5Y0000015l2WQAQ",
- "Nebula Logger - Plugin - Slack@0.10.0-2": "04t5Y0000015lgQQAQ"
+ "Nebula Logger - Plugin - Slack@0.9.0-beta-release": "04t5e00000061lHAAQ",
+ "Nebula Logger - Plugin - Slack@0.9.1-beta-release-round-2": "04t5e00000065xiAAA",
+ "Nebula Logger - Plugin - Slack@0.9.2-beta-release-round-3": "04t5Y0000015l2WQAQ",
+ "Nebula Logger - Plugin - Slack@0.10.0": "04t5Y0000015lgQQAQ",
+ "Nebula Logger - Plugin - Slack@1.5.0": "04t5Y0000015lvVQAQ"
}
}
diff --git a/supplemental-metadata/main/SF-Compliance-Metadata-Auditor/customMetadata/Data_Classification.default.md-meta.xml b/supplemental-metadata/main/SF-Compliance-Metadata-Auditor/customMetadata/Data_Classification.default.md-meta.xml
index d7345048a..e619f4d63 100644
--- a/supplemental-metadata/main/SF-Compliance-Metadata-Auditor/customMetadata/Data_Classification.default.md-meta.xml
+++ b/supplemental-metadata/main/SF-Compliance-Metadata-Auditor/customMetadata/Data_Classification.default.md-meta.xml
@@ -16,6 +16,6 @@
reportable_entity_json__c
["LogEntryArchive__b","LogEntryDataMaskRule__mdt","LogEntryEvent__e","LogEntryTagRule__mdt","LogEntryTag__c","LogEntry__c","LogScenarioRule__mdt","LogStatus__mdt","Log__c","LoggerParameter__mdt","LoggerPlugin__mdt","LogRetentionRule__mdt","LogRetentionRuleCondition__mdt","LoggerSObjectHandler__mdt","LoggerSObjectHandlerParameter__mdt","LoggerSObjectHandlerPlugin__mdt","LoggerSObjectHandlerPluginParameter__mdt","LoggerSettings__c","LoggerTag__c"]
+ >["LogEntryArchive__b","LogEntryDataMaskRule__mdt","LogEntryEvent__e","LogEntryTagRule__mdt","LogEntryTag__c","LogEntry__c","LoggerScenarioRule__mdt","LogStatus__mdt","Log__c","LoggerParameter__mdt","LoggerPlugin__mdt","LogRetentionRule__mdt","LogRetentionRuleCondition__mdt","LoggerSObjectHandler__mdt","LoggerSObjectHandlerParameter__mdt","LoggerSObjectHandlerPlugin__mdt","LoggerSObjectHandlerPluginParameter__mdt","LoggerSettings__c","LoggerTag__c"]