From e9ac3323cd8be1ec95495401dc992f76b2dd16f7 Mon Sep 17 00:00:00 2001 From: Jonathan Gillespie Date: Thu, 18 Nov 2021 10:25:48 -0500 Subject: [PATCH] SaveMethod support in Flow & Lightning Components, Regex filtering in logEntryEventStream component (#250) * Bumped API version from v52.0 to v53.0, updated flexipages to match API v53.0's format * Added getSaveMethod() method to Logger * Added the ability to specify a save method in all Flow invocable classes, cleaned up some comments in Flow classes * Added the ability to specify a save method in logger.js, add new getUserSettings() function * Fixed syntax in loggerLWCDemo.js for adding tags, updated version name for v4.6.13 * Fixes (some) of #212 by adding regular expression filtering to the logEntryEventStream component. Did some cleanup, as well (#251 by @jamessimone) Co-authored-by: James Simone <16430727+jamessimone@users.noreply.github.com> --- README.md | 6 +- docs/logger-engine/ComponentLogger.md | 13 +- docs/logger-engine/FlowCollectionLogEntry.md | 6 +- docs/logger-engine/FlowLogEntry.md | 10 +- docs/logger-engine/FlowLogger.md | 22 ++- docs/logger-engine/FlowRecordLogEntry.md | 6 +- docs/logger-engine/Logger.md | 14 ++ .../ExampleInboundEmailHandler.cls-meta.xml | 2 +- ...andler_Screen_Tests_for_Flow.flow-meta.xml | 2 +- .../LogEntryHandler_Tests_Flow.flow-meta.xml | 2 +- ...Handler_Tests_Scheduled_Flow.flow-meta.xml | 2 +- .../flows/LogHandler_Tests_Flow.flow-meta.xml | 2 +- ...EventBuilder_IntegrationTests.cls-meta.xml | 2 +- .../LogEntryHandler_Tests_Flow.cls-meta.xml | 2 +- .../tests/LogHandler_Tests_Flow.cls-meta.xml | 2 +- .../Logger_Tests_ExperienceSite.cls-meta.xml | 2 +- ...ger_Tests_InboundEmailHandler.cls-meta.xml | 2 +- .../Logger_Tests_MergeResult.cls-meta.xml | 2 +- .../classes/LoggerInstallHandler.cls-meta.xml | 2 +- .../LoggerInstallHandler_Tests.cls-meta.xml | 2 +- managed-package/sfdx-project.json | 2 +- .../classes/SlackLoggerPlugin.cls-meta.xml | 2 +- .../SlackLoggerPlugin_Tests.cls-meta.xml | 2 +- .../loggerAuraDemo.cmp-meta.xml | 2 +- .../Account_Batch_Logger_Example.cls-meta.xml | 2 +- ...ount_Queueable_Logger_Example.cls-meta.xml | 2 +- .../ExampleClassWithLogging.cls-meta.xml | 2 +- .../ExampleInboundEmailHandler.cls-meta.xml | 2 +- .../Account_Flow_Logger_Example.flow-meta.xml | 2 +- ...count_Process_Logger_Example.flow-meta.xml | 2 +- ...andler_Screen_Tests_for_Flow.flow-meta.xml | 2 +- .../LogEntryHandler_Tests_Flow.flow-meta.xml | 2 +- ...Handler_Tests_Scheduled_Flow.flow-meta.xml | 2 +- .../flows/LogHandler_Tests_Flow.flow-meta.xml | 2 +- .../lwc/loggerLWCDemo/loggerLWCDemo.js | 12 +- .../loggerLWCDemo/loggerLWCDemo.js-meta.xml | 2 +- ...nt_Trigger_Logger_Example.trigger-meta.xml | 2 +- .../classes/LoggerEmailUtils.cls-meta.xml | 2 +- .../classes/LoggerParameter.cls-meta.xml | 2 +- .../logJSONViewer/logJSONViewer.cmp-meta.xml | 2 +- .../LogBatchPurgeScheduler.cls-meta.xml | 2 +- .../classes/LogBatchPurger.cls-meta.xml | 2 +- .../classes/LogEntryEventHandler.cls-meta.xml | 2 +- .../LogEntryFieldSetPicklist.cls-meta.xml | 2 +- .../classes/LogEntryHandler.cls-meta.xml | 2 +- .../classes/LogEntryTagHandler.cls-meta.xml | 2 +- .../classes/LogHandler.cls-meta.xml | 2 +- .../LogMassDeleteExtension.cls-meta.xml | 2 +- .../classes/LoggerSObjectHandler.cls-meta.xml | 2 +- .../classes/LoggerTagHandler.cls-meta.xml | 2 +- .../RelatedLogEntriesController.cls-meta.xml | 2 +- .../LogEntryRecordPage.flexipage-meta.xml | 92 +++++++++ .../LogEntryTagRecordPage.flexipage-meta.xml | 3 + .../LogRecordPage.flexipage-meta.xml | 89 +++++++++ ...LoggerConsoleUtilityBar.flexipage-meta.xml | 1 + .../LoggerTagRecordPage.flexipage-meta.xml | 6 + .../__tests__/logEntryEventStream.test.js | 46 +++-- .../logEntryEventStream.html | 27 ++- .../logEntryEventStream.js | 104 +++++----- .../logEntryEventStream.js-meta.xml | 2 +- .../lwc/logViewer/logViewer.js-meta.xml | 2 +- .../__tests__/data/getQueryResult.json | 16 +- .../relatedLogEntries.js-meta.xml | 2 +- .../pages/LogMassDelete.page-meta.xml | 2 +- .../triggers/Log.trigger-meta.xml | 2 +- .../triggers/LogEntry.trigger-meta.xml | 2 +- .../triggers/LogEntryEvent.trigger-meta.xml | 2 +- .../triggers/LogEntryTag.trigger-meta.xml | 2 +- .../triggers/LoggerTag.trigger-meta.xml | 2 +- .../logger-engine/classes/ComponentLogger.cls | 17 +- .../classes/ComponentLogger.cls-meta.xml | 2 +- .../classes/FlowCollectionLogEntry.cls | 8 +- .../FlowCollectionLogEntry.cls-meta.xml | 2 +- .../logger-engine/classes/FlowLogEntry.cls | 12 +- .../classes/FlowLogEntry.cls-meta.xml | 2 +- .../main/logger-engine/classes/FlowLogger.cls | 29 ++- .../classes/FlowLogger.cls-meta.xml | 2 +- .../classes/FlowRecordLogEntry.cls | 8 +- .../classes/FlowRecordLogEntry.cls-meta.xml | 2 +- .../classes/LogEntryEventBuilder.cls | 2 +- .../classes/LogEntryEventBuilder.cls-meta.xml | 2 +- .../classes/LogMessage.cls-meta.xml | 2 +- .../main/logger-engine/classes/Logger.cls | 12 +- .../logger-engine/classes/Logger.cls-meta.xml | 2 +- .../__tests__/data/getLoggerSettings.json | 1 + .../lwc/logger/__tests__/logger.test.js | 186 ++++++++++-------- .../main/logger-engine/lwc/logger/logger.js | 29 ++- .../lwc/logger/logger.js-meta.xml | 2 +- .../LoggerSObjectHandlerPlugin.cls-meta.xml | 2 +- .../classes/LoggerTestUtils.cls-meta.xml | 2 +- .../LoggerEmailUtils_Tests.cls-meta.xml | 2 +- .../LoggerParameter_Tests.cls-meta.xml | 2 +- .../LogBatchPurgeScheduler_Tests.cls-meta.xml | 2 +- .../classes/LogBatchPurger_Tests.cls-meta.xml | 2 +- .../LogEntryEventHandler_Tests.cls-meta.xml | 2 +- ...ogEntryFieldSetPicklist_Tests.cls-meta.xml | 2 +- .../LogEntryHandler_Tests.cls-meta.xml | 2 +- .../LogEntryTagHandler_Tests.cls-meta.xml | 2 +- .../classes/LogHandler_Tests.cls-meta.xml | 2 +- .../LogMassDeleteExtension_Tests.cls-meta.xml | 2 +- .../LoggerTagHandler_Tests.cls-meta.xml | 2 +- ...tedLogEntriesController_Tests.cls-meta.xml | 2 +- .../classes/ComponentLogger_Tests.cls | 53 ++++- .../ComponentLogger_Tests.cls-meta.xml | 2 +- .../classes/FlowCollectionLogEntry_Tests.cls | 45 +++++ .../FlowCollectionLogEntry_Tests.cls-meta.xml | 2 +- .../classes/FlowLogEntry_Tests.cls | 31 +++ .../classes/FlowLogEntry_Tests.cls-meta.xml | 2 +- .../classes/FlowLogger_Tests.cls | 29 +++ .../classes/FlowLogger_Tests.cls-meta.xml | 2 +- .../classes/FlowRecordLogEntry_Tests.cls | 43 ++++ .../FlowRecordLogEntry_Tests.cls-meta.xml | 2 +- .../LogEntryEventBuilder_Tests.cls-meta.xml | 2 +- .../classes/LogMessage_Tests.cls-meta.xml | 2 +- .../logger-engine/classes/Logger_Tests.cls | 126 +++++++++++- .../classes/Logger_Tests.cls-meta.xml | 2 +- ...gerSObjectHandlerPlugin_Tests.cls-meta.xml | 2 +- package.json | 6 +- scripts/build/generate-docs.ps1 | 2 +- sfdx-project.json | 9 +- 120 files changed, 955 insertions(+), 334 deletions(-) diff --git a/README.md b/README.md index a4361884e..8dc0417ad 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ Designed for Salesforce admins, developers & architects. A robust logger for Apex, Lightning Components, Flow, Process Builder & Integrations. -## Unlocked Package - v4.6.12 +## Unlocked Package - v4.6.13 -[![Install Unlocked Package in a Sandbox](./content/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3oQAA) -[![Install Unlocked Package in Production](./content/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3oQAA) +[![Install Unlocked Package in a Sandbox](./content/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l4cQAA) +[![Install Unlocked Package in Production](./content/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l4cQAA) [![View Documentation](./content/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/) ## Managed Package - v4.6.0 diff --git a/docs/logger-engine/ComponentLogger.md b/docs/logger-engine/ComponentLogger.md index eaa5a4315..318a24d4a 100644 --- a/docs/logger-engine/ComponentLogger.md +++ b/docs/logger-engine/ComponentLogger.md @@ -30,15 +30,16 @@ ComponentLoggerSettings return The instance of `ComponentLoggerSettings` for the current user -#### `saveComponentLogEntries(List componentLogEntries)` → `String` +#### `saveComponentLogEntries(List componentLogEntries, String saveMethodName)` → `String` saveComponentLogEntries Saves log entries created via lwc or aura components ##### Parameters -| Param | Description | -| --------------------- | ------------------------------------------------------------ | -| `componentLogEntries` | The list of `ComponentLogEntry` objects to save via `Logger` | +| Param | Description | +| --------------------- | -------------------------------------------------------------------- | +| `componentLogEntries` | The list of `ComponentLogEntry` objects to save via `Logger` | +| `saveMethodName` | String name of the instance of Logger.SaveMethod to use when saving. | ##### Return @@ -130,6 +131,10 @@ A DTO object used for passing `LoggerSettings__c` details to lightning component ##### Properties +###### `defaultSaveMethodName` → `String` + +Indicates the save method that will be used by default if no other save method is specified, based on `LoggerSettings__c.DefaultSaveMethod__c` + ###### `isConsoleLoggingEnabled` → `Boolean` Indicates if logging via the browser's `console.log()` is enabled for the current user, based on `Logger.IsComponentConsoleLoggingEnabled__c` diff --git a/docs/logger-engine/FlowCollectionLogEntry.md b/docs/logger-engine/FlowCollectionLogEntry.md index 678a6c6c1..cb5cb4a07 100644 --- a/docs/logger-engine/FlowCollectionLogEntry.md +++ b/docs/logger-engine/FlowCollectionLogEntry.md @@ -28,7 +28,7 @@ Optionally log a Flow fault error message #### `flowName` → `String` -The name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined +The API name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined #### `loggingLevelName` → `String` @@ -46,6 +46,10 @@ The records to relate to this log entry - the records' JSON is automaticall Optionally choose to save any pending log entries +#### `saveMethodName` → `String` + +Optionally choose the save method to use when 'Save Log' is true + #### `scenario` → `String` Optionally specify the name to use for the current transaction's scenario diff --git a/docs/logger-engine/FlowLogEntry.md b/docs/logger-engine/FlowLogEntry.md index bcfb0adb5..9e88e9ec6 100644 --- a/docs/logger-engine/FlowLogEntry.md +++ b/docs/logger-engine/FlowLogEntry.md @@ -28,7 +28,7 @@ Optionally log a Flow fault error message #### `flowName` → `String` -The name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined. +The API name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined. #### `loggingLevelName` → `String` @@ -36,7 +36,7 @@ Optionally specify a logging level - the default is 'DEBUG' #### `message` → `String` -The message to log. +The message to log #### `recordId` → `Id` @@ -44,7 +44,11 @@ Optionally relate the log entry to a particular record ID #### `saveLog` → `Boolean` -Optionally choose to save any pending log entries. +Optionally choose to save any pending log entries + +#### `saveMethodName` → `String` + +Optionally choose the save method to use when 'Save Log' is true #### `scenario` → `String` diff --git a/docs/logger-engine/FlowLogger.md b/docs/logger-engine/FlowLogger.md index 249a91eff..28b42e009 100644 --- a/docs/logger-engine/FlowLogger.md +++ b/docs/logger-engine/FlowLogger.md @@ -60,27 +60,31 @@ String containing fault message, if applicable ###### `flowName` → `String` -name of the flow. +API name of the flow ###### `loggingLevelName` → `String` -String containing the logging level. +String name of the entry's logging level ###### `message` → `String` -General message to log. +General message to log ###### `saveLog` → `Boolean` -boolean used to determine if logs are saved to Salesforce. +Boolean used to determine if logs are saved to Salesforce + +###### `saveMethodName` → `String` + +String name of the instance of Logger.SaveMethod to use when 'Save Log' == true ###### `scenario` → `String` -Optionally specify the name to use for the current transaction's scenario +Optionally specify the scenario to use for the current transaction ###### `tagsString` → `String` -String of tags / topics. +Comma-separated string of tags ###### `timestamp` → `DateTime` @@ -88,7 +92,7 @@ timestamp of the log ###### `topics` → `List` -List of tags / topics. +List of tags / topics --- @@ -96,7 +100,7 @@ List of tags / topics. ###### `addToLoggerBuffer()` → `LogEntryEventBuilder` -Adds the logger to the buffer. +Adds the logger to the buffer ####### Return @@ -106,6 +110,6 @@ LogEntryEventBuilder **Description** -An instance of LogEntryEventBuilder. +An instance of LogEntryEventBuilder --- diff --git a/docs/logger-engine/FlowRecordLogEntry.md b/docs/logger-engine/FlowRecordLogEntry.md index 4a2ddce1a..d94db2d7f 100644 --- a/docs/logger-engine/FlowRecordLogEntry.md +++ b/docs/logger-engine/FlowRecordLogEntry.md @@ -28,7 +28,7 @@ Optionally log a Flow fault error message #### `flowName` → `String` -The name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined +The API name of the Flow creating the log entry. Due to Salesforce limitations, this cannot be automatically determined #### `loggingLevelName` → `String` @@ -46,6 +46,10 @@ The record to relate to this log entry - the record's JSON is automatically Optionally choose to save any pending log entries +#### `saveMethodName` → `String` + +Optionally choose the save method to use when 'Save Log' is true + #### `scenario` → `String` Optionally specify the name to use for the current transaction's scenario diff --git a/docs/logger-engine/Logger.md b/docs/logger-engine/Logger.md index ea7d7e97e..40a862c3e 100644 --- a/docs/logger-engine/Logger.md +++ b/docs/logger-engine/Logger.md @@ -3230,6 +3230,20 @@ String String - The parent log's transaction ID. This must be explicitly set by calling setParentLogTransactionId(String) +#### `getSaveMethod()` → `SaveMethod` + +Returns the default save method used when calling saveLog() - set via LoggerSettings\_\_c or by calling setSaveMethod(SaveMethod saveMethod) + +##### Return + +**Type** + +SaveMethod + +**Description** + +The enum value of Logger.SaveMethod to use for any calls to saveLog() in the current transaction + #### `getTransactionId()` → `String` Returns the unique ID for a particular transaction, stored in Log**c.TransactionId**c diff --git a/extra-tests/classes/ExampleInboundEmailHandler.cls-meta.xml b/extra-tests/classes/ExampleInboundEmailHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/classes/ExampleInboundEmailHandler.cls-meta.xml +++ b/extra-tests/classes/ExampleInboundEmailHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml b/extra-tests/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml index ea594c18b..034acd1d0 100644 --- a/extra-tests/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml +++ b/extra-tests/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml @@ -87,7 +87,7 @@ true - 52.0 + 53.0 A screen Flow used to help test the Apex class LogEntryHandler LogEntryHandler Screen Tests for Flow {!$Flow.CurrentDateTime} diff --git a/extra-tests/flows/LogEntryHandler_Tests_Flow.flow-meta.xml b/extra-tests/flows/LogEntryHandler_Tests_Flow.flow-meta.xml index 3b5abbaee..dcfa7aa71 100644 --- a/extra-tests/flows/LogEntryHandler_Tests_Flow.flow-meta.xml +++ b/extra-tests/flows/LogEntryHandler_Tests_Flow.flow-meta.xml @@ -50,7 +50,7 @@ true - 50.0 + 53.0 An auto-launched Flow used to help test the Apex class LogEntryHandler LogEntryHandler_Tests_Flow {!$Flow.CurrentDateTime} diff --git a/extra-tests/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml b/extra-tests/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml index 026b4beda..1145e9244 100644 --- a/extra-tests/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml +++ b/extra-tests/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml @@ -50,7 +50,7 @@ true - 52.0 + 53.0 A scheduled Flow used in tests to verify that LogEntryHandler automatically logs details about the Flow (metadata data) LogEntryHandler_Tests_Scheduled_Flow {!$Flow.CurrentDateTime} diff --git a/extra-tests/flows/LogHandler_Tests_Flow.flow-meta.xml b/extra-tests/flows/LogHandler_Tests_Flow.flow-meta.xml index dafdf52ac..5bc99449f 100644 --- a/extra-tests/flows/LogHandler_Tests_Flow.flow-meta.xml +++ b/extra-tests/flows/LogHandler_Tests_Flow.flow-meta.xml @@ -97,7 +97,7 @@ true - 49.0 + 53.0 Update_user_s_first_name diff --git a/extra-tests/tests/LogEntryEventBuilder_IntegrationTests.cls-meta.xml b/extra-tests/tests/LogEntryEventBuilder_IntegrationTests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/LogEntryEventBuilder_IntegrationTests.cls-meta.xml +++ b/extra-tests/tests/LogEntryEventBuilder_IntegrationTests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/tests/LogEntryHandler_Tests_Flow.cls-meta.xml b/extra-tests/tests/LogEntryHandler_Tests_Flow.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/LogEntryHandler_Tests_Flow.cls-meta.xml +++ b/extra-tests/tests/LogEntryHandler_Tests_Flow.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/tests/LogHandler_Tests_Flow.cls-meta.xml b/extra-tests/tests/LogHandler_Tests_Flow.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/LogHandler_Tests_Flow.cls-meta.xml +++ b/extra-tests/tests/LogHandler_Tests_Flow.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/tests/Logger_Tests_ExperienceSite.cls-meta.xml b/extra-tests/tests/Logger_Tests_ExperienceSite.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/Logger_Tests_ExperienceSite.cls-meta.xml +++ b/extra-tests/tests/Logger_Tests_ExperienceSite.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls-meta.xml b/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls-meta.xml +++ b/extra-tests/tests/Logger_Tests_InboundEmailHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/extra-tests/tests/Logger_Tests_MergeResult.cls-meta.xml b/extra-tests/tests/Logger_Tests_MergeResult.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/extra-tests/tests/Logger_Tests_MergeResult.cls-meta.xml +++ b/extra-tests/tests/Logger_Tests_MergeResult.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/managed-package/managed-package-metadata/classes/LoggerInstallHandler.cls-meta.xml b/managed-package/managed-package-metadata/classes/LoggerInstallHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/managed-package/managed-package-metadata/classes/LoggerInstallHandler.cls-meta.xml +++ b/managed-package/managed-package-metadata/classes/LoggerInstallHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/managed-package/managed-package-metadata/classes/LoggerInstallHandler_Tests.cls-meta.xml b/managed-package/managed-package-metadata/classes/LoggerInstallHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/managed-package/managed-package-metadata/classes/LoggerInstallHandler_Tests.cls-meta.xml +++ b/managed-package/managed-package-metadata/classes/LoggerInstallHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/managed-package/sfdx-project.json b/managed-package/sfdx-project.json index a12fe4ea1..c73c2de6b 100644 --- a/managed-package/sfdx-project.json +++ b/managed-package/sfdx-project.json @@ -1,7 +1,7 @@ { "namespace": "Nebula", "sfdcLoginUrl": "https://login.salesforce.com", - "sourceApiVersion": "52.0", + "sourceApiVersion": "53.0", "packageDirectories": [ { "package": "Nebula Logger - Managed Package", diff --git a/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin.cls-meta.xml b/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin.cls-meta.xml +++ b/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin_Tests.cls-meta.xml b/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin_Tests.cls-meta.xml +++ b/nebula-logger-plugins/Slack/classes/SlackLoggerPlugin_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-recipes/main/default/aura/loggerAuraDemo/loggerAuraDemo.cmp-meta.xml b/nebula-logger-recipes/main/default/aura/loggerAuraDemo/loggerAuraDemo.cmp-meta.xml index 1962ba343..205a523da 100644 --- a/nebula-logger-recipes/main/default/aura/loggerAuraDemo/loggerAuraDemo.cmp-meta.xml +++ b/nebula-logger-recipes/main/default/aura/loggerAuraDemo/loggerAuraDemo.cmp-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 A Lightning Component Bundle diff --git a/nebula-logger-recipes/main/default/classes/Account_Batch_Logger_Example.cls-meta.xml b/nebula-logger-recipes/main/default/classes/Account_Batch_Logger_Example.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-recipes/main/default/classes/Account_Batch_Logger_Example.cls-meta.xml +++ b/nebula-logger-recipes/main/default/classes/Account_Batch_Logger_Example.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-recipes/main/default/classes/Account_Queueable_Logger_Example.cls-meta.xml b/nebula-logger-recipes/main/default/classes/Account_Queueable_Logger_Example.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-recipes/main/default/classes/Account_Queueable_Logger_Example.cls-meta.xml +++ b/nebula-logger-recipes/main/default/classes/Account_Queueable_Logger_Example.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-recipes/main/default/classes/ExampleClassWithLogging.cls-meta.xml b/nebula-logger-recipes/main/default/classes/ExampleClassWithLogging.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-recipes/main/default/classes/ExampleClassWithLogging.cls-meta.xml +++ b/nebula-logger-recipes/main/default/classes/ExampleClassWithLogging.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-recipes/main/default/classes/ExampleInboundEmailHandler.cls-meta.xml b/nebula-logger-recipes/main/default/classes/ExampleInboundEmailHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger-recipes/main/default/classes/ExampleInboundEmailHandler.cls-meta.xml +++ b/nebula-logger-recipes/main/default/classes/ExampleInboundEmailHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger-recipes/main/default/flows/Account_Flow_Logger_Example.flow-meta.xml b/nebula-logger-recipes/main/default/flows/Account_Flow_Logger_Example.flow-meta.xml index c03addb27..cd4815f54 100644 --- a/nebula-logger-recipes/main/default/flows/Account_Flow_Logger_Example.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/Account_Flow_Logger_Example.flow-meta.xml @@ -81,7 +81,7 @@ true - 52.0 + 53.0 An example field update Update_Account diff --git a/nebula-logger-recipes/main/default/flows/Account_Process_Logger_Example.flow-meta.xml b/nebula-logger-recipes/main/default/flows/Account_Process_Logger_Example.flow-meta.xml index 2149326a4..7acf21f36 100644 --- a/nebula-logger-recipes/main/default/flows/Account_Process_Logger_Example.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/Account_Process_Logger_Example.flow-meta.xml @@ -354,7 +354,7 @@ - 52.0 + 53.0 index diff --git a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml index ea594c18b..034acd1d0 100644 --- a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Screen_Tests_for_Flow.flow-meta.xml @@ -87,7 +87,7 @@ true - 52.0 + 53.0 A screen Flow used to help test the Apex class LogEntryHandler LogEntryHandler Screen Tests for Flow {!$Flow.CurrentDateTime} diff --git a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Flow.flow-meta.xml b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Flow.flow-meta.xml index 3b5abbaee..dcfa7aa71 100644 --- a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Flow.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Flow.flow-meta.xml @@ -50,7 +50,7 @@ true - 50.0 + 53.0 An auto-launched Flow used to help test the Apex class LogEntryHandler LogEntryHandler_Tests_Flow {!$Flow.CurrentDateTime} diff --git a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml index 026b4beda..1145e9244 100644 --- a/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/LogEntryHandler_Tests_Scheduled_Flow.flow-meta.xml @@ -50,7 +50,7 @@ true - 52.0 + 53.0 A scheduled Flow used in tests to verify that LogEntryHandler automatically logs details about the Flow (metadata data) LogEntryHandler_Tests_Scheduled_Flow {!$Flow.CurrentDateTime} diff --git a/nebula-logger-recipes/main/default/flows/LogHandler_Tests_Flow.flow-meta.xml b/nebula-logger-recipes/main/default/flows/LogHandler_Tests_Flow.flow-meta.xml index dafdf52ac..5bc99449f 100644 --- a/nebula-logger-recipes/main/default/flows/LogHandler_Tests_Flow.flow-meta.xml +++ b/nebula-logger-recipes/main/default/flows/LogHandler_Tests_Flow.flow-meta.xml @@ -97,7 +97,7 @@ true - 49.0 + 53.0 Update_user_s_first_name diff --git a/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js b/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js index 7f33a728b..0ebd8f740 100644 --- a/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js +++ b/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js @@ -38,35 +38,35 @@ export default class LoggerLWCDemo extends LightningElement { console.log('running logWarn for btn'); const logger = this.template.querySelector(LOGGER_NAME); console.log(logger); - logger.warn(this.message, { tags: this.tagsString.split(',') }); + logger.warn(this.message).addTags(this.tagsString.split(',')); } logInfoExample() { console.log('running logInfo for btn'); const logger = this.template.querySelector(LOGGER_NAME); console.log(logger); - logger.info(this.message, { tags: this.tagsString.split(',') }); + logger.info(this.message).addTags(this.tagsString.split(',')); } logDebugExample() { console.log('running logDebug for btn'); const logger = this.template.querySelector(LOGGER_NAME); console.log(logger); - logger.debug(this.message, { tags: this.tagsString.split(',') }); + logger.debug(this.message).addTags(this.tagsString.split(',')); } logFineExample() { console.log('running logFine for btn'); const logger = this.template.querySelector(LOGGER_NAME); console.log(logger); - logger.fine(this.message, { tags: this.tagsString.split(',') }); + logger.fine(this.message).addTags(this.tagsString.split(',')); } logFinerExample() { console.log('running logFiner for btn'); const logger = this.template.querySelector(LOGGER_NAME); console.log(logger); - logger.finer(this.message, { tags: this.tagsString.split(',') }); + logger.finer(this.message).addTags(this.tagsString.split(',')); } logFinestExample() { @@ -81,6 +81,6 @@ export default class LoggerLWCDemo extends LightningElement { const logger = this.template.querySelector(LOGGER_NAME); logger.setScenario(this.scenario); console.log(logger); - logger.saveLog(); + logger.saveLog('QUEUEABLE'); } } diff --git a/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js-meta.xml b/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js-meta.xml index 82356d444..dfbcea192 100644 --- a/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js-meta.xml +++ b/nebula-logger-recipes/main/default/lwc/loggerLWCDemo/loggerLWCDemo.js-meta.xml @@ -1,6 +1,6 @@ - 52.0 + 53.0 true lightning__Tab diff --git a/nebula-logger-recipes/main/default/triggers/Account_Trigger_Logger_Example.trigger-meta.xml b/nebula-logger-recipes/main/default/triggers/Account_Trigger_Logger_Example.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger-recipes/main/default/triggers/Account_Trigger_Logger_Example.trigger-meta.xml +++ b/nebula-logger-recipes/main/default/triggers/Account_Trigger_Logger_Example.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/configuration/classes/LoggerEmailUtils.cls-meta.xml b/nebula-logger/main/configuration/classes/LoggerEmailUtils.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/configuration/classes/LoggerEmailUtils.cls-meta.xml +++ b/nebula-logger/main/configuration/classes/LoggerEmailUtils.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/configuration/classes/LoggerParameter.cls-meta.xml b/nebula-logger/main/configuration/classes/LoggerParameter.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/configuration/classes/LoggerParameter.cls-meta.xml +++ b/nebula-logger/main/configuration/classes/LoggerParameter.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/aura/logJSONViewer/logJSONViewer.cmp-meta.xml b/nebula-logger/main/log-management/aura/logJSONViewer/logJSONViewer.cmp-meta.xml index ebf56f5a3..ea2fdc145 100644 --- a/nebula-logger/main/log-management/aura/logJSONViewer/logJSONViewer.cmp-meta.xml +++ b/nebula-logger/main/log-management/aura/logJSONViewer/logJSONViewer.cmp-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 View a log and its entries in JSON format diff --git a/nebula-logger/main/log-management/classes/LogBatchPurgeScheduler.cls-meta.xml b/nebula-logger/main/log-management/classes/LogBatchPurgeScheduler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogBatchPurgeScheduler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogBatchPurgeScheduler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogBatchPurger.cls-meta.xml b/nebula-logger/main/log-management/classes/LogBatchPurger.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogBatchPurger.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogBatchPurger.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogEntryEventHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LogEntryEventHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogEntryEventHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogEntryEventHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogEntryFieldSetPicklist.cls-meta.xml b/nebula-logger/main/log-management/classes/LogEntryFieldSetPicklist.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogEntryFieldSetPicklist.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogEntryFieldSetPicklist.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogEntryHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LogEntryHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogEntryHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogEntryHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogEntryTagHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LogEntryTagHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogEntryTagHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogEntryTagHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LogHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LogMassDeleteExtension.cls-meta.xml b/nebula-logger/main/log-management/classes/LogMassDeleteExtension.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LogMassDeleteExtension.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LogMassDeleteExtension.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LoggerSObjectHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LoggerSObjectHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LoggerSObjectHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LoggerSObjectHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/LoggerTagHandler.cls-meta.xml b/nebula-logger/main/log-management/classes/LoggerTagHandler.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/LoggerTagHandler.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/LoggerTagHandler.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/classes/RelatedLogEntriesController.cls-meta.xml b/nebula-logger/main/log-management/classes/RelatedLogEntriesController.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/log-management/classes/RelatedLogEntriesController.cls-meta.xml +++ b/nebula-logger/main/log-management/classes/RelatedLogEntriesController.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml b/nebula-logger/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml index d2189acb7..e81e5a682 100644 --- a/nebula-logger/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml +++ b/nebula-logger/main/log-management/flexipages/LogEntryRecordPage.flexipage-meta.xml @@ -20,6 +20,7 @@ 10 force:highlightsPanel + force_highlightsPanel header @@ -33,6 +34,7 @@ required Record.Log__c + RecordLog__cField @@ -42,6 +44,7 @@ readonly Record.LoggedByUsernameLink__c + RecordLoggedByUsernameLink__cField @@ -51,6 +54,7 @@ readonly Record.Timestamp__c + RecordTimestamp__cField @@ -60,6 +64,7 @@ readonly Record.EpochTimestamp__c + RecordEpochTimestamp__cField Facet-cb40f95d-9915-4ba5-815c-f3e53bcc4001 @@ -73,6 +78,7 @@ readonly Record.LoggingLevelWithImage__c + RecordLoggingLevelWithImage__cField @@ -82,6 +88,7 @@ readonly Record.Origin__c + RecordOrigin__cField @@ -91,6 +98,7 @@ readonly Record.Trigger__c + RecordTrigger__cField {!Record.TriggerIsExecuting__c} @@ -107,6 +115,7 @@ readonly Record.EventUuid__c + RecordEventUuid__cField @@ -116,6 +125,7 @@ readonly Record.TransactionEntryNumber__c + RecordTransactionEntryNumber__cField Facet-f419a303-8d53-44e5-8647-63a464804568 @@ -129,6 +139,7 @@ Facet-cb40f95d-9915-4ba5-815c-f3e53bcc4001 flexipage:column + flexipage_column @@ -138,6 +149,7 @@ Facet-f419a303-8d53-44e5-8647-63a464804568 flexipage:column + flexipage_column2 Facet-506803d6-0468-4ac1-a044-ede56cf84c05 @@ -151,6 +163,7 @@ none Record.Message__c + RecordMessage__cField @@ -160,6 +173,7 @@ readonly Record.MessageTruncated__c + RecordMessageTruncated__cField @@ -169,6 +183,7 @@ readonly Record.MessageMasked__c + RecordMessageMasked__cField @@ -178,6 +193,7 @@ none Record.StackTrace__c + RecordStackTrace__cField {!Record.HasStackTrace__c} @@ -198,6 +214,7 @@ Facet-30caba7c-11da-4321-bccd-e97e901d03f4 flexipage:column + flexipage_column3 Facet-3a75f17f-589a-49f4-bdec-38f730e94676 @@ -211,6 +228,7 @@ readonly Record.ApexClassName__c + RecordApexClassName__cField @@ -220,6 +238,7 @@ readonly Record.ApexInnerClassName__c + RecordApexInnerClassName__cField {!Record.ApexInnerClassName__c} @@ -235,6 +254,7 @@ readonly Record.ApexMethodName__c + RecordApexMethodName__cField @@ -244,6 +264,7 @@ readonly Record.ApexClassApiVersion__c + RecordApexClassApiVersion__cField Facet-eb0dd886-ca25-4094-b405-b0653a844c4c @@ -257,6 +278,7 @@ readonly Record.ApexClassId__c + RecordApexClassId__cField @@ -266,6 +288,7 @@ readonly Record.ApexClassCreatedDate__c + RecordApexClassCreatedDate__cField @@ -275,6 +298,7 @@ readonly Record.ApexClassLastModifiedDate__c + RecordApexClassLastModifiedDate__cField Facet-a59c58c4-ed12-445a-b526-b1fdb0225dfd @@ -288,6 +312,7 @@ Facet-eb0dd886-ca25-4094-b405-b0653a844c4c flexipage:column + flexipage_column4 @@ -297,6 +322,7 @@ Facet-a59c58c4-ed12-445a-b526-b1fdb0225dfd flexipage:column + flexipage_column5 Facet-a417c39b-b395-4d13-a87d-2d5bbb9d9d77 @@ -310,6 +336,7 @@ readonly Record.ComponentType__c + RecordComponentType__cField @@ -319,6 +346,7 @@ readonly Record.ComponentApiName__c + RecordComponentApiName__cField Facet-dc259053-1bb7-4620-814d-e4f04eca75c2 @@ -332,6 +360,7 @@ readonly Record.ComponentFunctionName__c + RecordComponentFunctionName__cField Facet-91b743b5-7408-4da0-9cf3-e3fbd695545d @@ -345,6 +374,7 @@ Facet-dc259053-1bb7-4620-814d-e4f04eca75c2 flexipage:column + flexipage_column6 @@ -354,6 +384,7 @@ Facet-91b743b5-7408-4da0-9cf3-e3fbd695545d flexipage:column + flexipage_column7 Facet-6b39517d-52f9-42f2-bf33-d392592baaa4 @@ -367,6 +398,7 @@ readonly Record.FlowLabel__c + RecordFlowLabel__cField @@ -376,6 +408,7 @@ readonly Record.FlowProcessType__c + RecordFlowProcessType__cField @@ -385,6 +418,7 @@ readonly Record.FlowTriggerType__c + RecordFlowTriggerType__cField @@ -394,6 +428,7 @@ readonly Record.FlowVersionRunInMode__c + RecordFlowVersionRunInMode__cField @@ -403,6 +438,7 @@ readonly Record.FlowVersionApiVersionRuntime__c + RecordFlowVersionApiVersionRuntime__cField @@ -412,6 +448,7 @@ readonly Record.FlowDescription__c + RecordFlowDescription__cField Facet-17586de5-b418-46c3-8e43-07f6a5e7321a @@ -425,6 +462,7 @@ readonly Record.FlowDurableId__c + RecordFlowDurableId__cField @@ -434,6 +472,7 @@ readonly Record.FlowActiveVersionId__c + RecordFlowActiveVersionId__cField @@ -443,6 +482,7 @@ readonly Record.FlowVersionNumber__c + RecordFlowVersionNumber__cField @@ -452,6 +492,7 @@ readonly Record.FlowLastModifiedByName__c + RecordFlowLastModifiedByName__cField @@ -461,6 +502,7 @@ readonly Record.FlowLastModifiedDate__c + RecordFlowLastModifiedDate__cField Facet-f9b96f42-358a-4ffe-bc2c-a20f42bd59b8 @@ -474,6 +516,7 @@ Facet-17586de5-b418-46c3-8e43-07f6a5e7321a flexipage:column + flexipage_column8 @@ -483,6 +526,7 @@ Facet-f9b96f42-358a-4ffe-bc2c-a20f42bd59b8 flexipage:column + flexipage_column9 Facet-5f20b7f6-e40f-49b2-905b-5e2ca6c609e9 @@ -496,6 +540,7 @@ none Record.ExceptionType__c + RecordExceptionType__cField @@ -505,6 +550,7 @@ none Record.ExceptionMessage__c + RecordExceptionMessage__cField @@ -514,6 +560,7 @@ none Record.ExceptionStackTrace__c + RecordExceptionStackTrace__cField {!Record.HasExceptionStackTrace__c} @@ -534,6 +581,7 @@ Facet-2459e7ac-69ae-42c7-a640-3fd29367e57b flexipage:column + flexipage_column10 Facet-2a15cd64-78af-4727-8c6d-2913cb00a278 @@ -547,6 +595,7 @@ readonly Record.DatabaseResultCollectionType__c + RecordDatabaseResultCollectionType__cField @@ -556,6 +605,7 @@ readonly Record.DatabaseResultType__c + RecordDatabaseResultType__cField @@ -565,6 +615,7 @@ readonly Record.DatabaseResultJson__c + RecordDatabaseResultJson__cField Facet-839d3f77-0b78-43a9-9477-6b63126dcf12 @@ -578,6 +629,7 @@ Facet-839d3f77-0b78-43a9-9477-6b63126dcf12 flexipage:column + flexipage_column11 Facet-b0b8c0ec-36e3-469b-9106-00d34530d793 @@ -591,6 +643,7 @@ readonly Record.RecordCollectionType__c + RecordRecordCollectionType__cField @@ -600,6 +653,7 @@ readonly Record.RecordSObjectType__c + RecordRecordSObjectType__cField @@ -609,6 +663,7 @@ readonly Record.RecordId__c + RecordRecordId__cField {!Record.HasRecordId__c} @@ -625,6 +680,7 @@ readonly Record.RecordSObjectClassification__c + RecordRecordSObjectClassification__cField @@ -634,6 +690,7 @@ readonly Record.RecordSObjectTypeNamespace__c + RecordRecordSObjectTypeNamespace__cField @@ -643,6 +700,7 @@ readonly Record.RecordLink__c + RecordRecordLink__cField @@ -652,6 +710,7 @@ readonly Record.RecordJson__c + RecordRecordJson__cField {!Record.HasRecordJson__c} @@ -668,6 +727,7 @@ readonly Record.RecordJsonMasked__c + RecordRecordJsonMasked__cField {!Record.HasRecordJson__c} @@ -688,6 +748,7 @@ Facet-1da92bf7-f9ed-4842-b880-7625370f3c70 flexipage:column + flexipage_column12 Facet-f6d04c17-cbcd-40c6-aa58-c46313ecd8c4 @@ -701,6 +762,7 @@ readonly Record.LimitsAggregateQueries__c + RecordLimitsAggregateQueries__cField @@ -710,6 +772,7 @@ readonly Record.LimitsAsyncCalls__c + RecordLimitsAsyncCalls__cField @@ -719,6 +782,7 @@ readonly Record.LimitsCallouts__c + RecordLimitsCallouts__cField @@ -728,6 +792,7 @@ readonly Record.LimitsCpuTime__c + RecordLimitsCpuTime__cField @@ -737,6 +802,7 @@ readonly Record.LimitsDmlRows__c + RecordLimitsDmlRows__cField @@ -746,6 +812,7 @@ readonly Record.LimitsDmlStatements__c + RecordLimitsDmlStatements__cField @@ -755,6 +822,7 @@ readonly Record.LimitsEmailInvocations__c + RecordLimitsEmailInvocations__cField @@ -764,6 +832,7 @@ readonly Record.LimitsFutureCalls__c + RecordLimitsFutureCalls__cField Facet-8e5572ea-8a8e-4426-8154-004cbbcb1314 @@ -777,6 +846,7 @@ readonly Record.LimitsHeapSize__c + RecordLimitsHeapSize__cField @@ -786,6 +856,7 @@ readonly Record.LimitsMobilePushApexCalls__c + RecordLimitsMobilePushApexCalls__cField @@ -795,6 +866,7 @@ readonly Record.LimitsPublishImmediateDmlStatements__c + RecordLimitsPublishImmediateDmlStatements__cField @@ -804,6 +876,7 @@ readonly Record.LimitsQueueableJobs__c + RecordLimitsQueueableJobs__cField @@ -813,6 +886,7 @@ readonly Record.LimitsSoqlQueries__c + RecordLimitsSoqlQueries__cField @@ -822,6 +896,7 @@ readonly Record.LimitsSoqlQueryLocatorRows__c + RecordLimitsSoqlQueryLocatorRows__cField @@ -831,6 +906,7 @@ readonly Record.LimitsSoqlQueryRows__c + RecordLimitsSoqlQueryRows__cField @@ -840,6 +916,7 @@ readonly Record.LimitsSoslSearches__c + RecordLimitsSoslSearches__cField Facet-ce9617b4-fac3-4077-93b0-d2ced40ad0b1 @@ -853,6 +930,7 @@ Facet-8e5572ea-8a8e-4426-8154-004cbbcb1314 flexipage:column + flexipage_column13 @@ -862,6 +940,7 @@ Facet-ce9617b4-fac3-4077-93b0-d2ced40ad0b1 flexipage:column + flexipage_column14 Facet-4fa5f475-f3a7-4ac0-b1cd-8285d7b369c7 @@ -879,6 +958,7 @@ Information flexipage:fieldSection + flexipage_fieldSection @@ -892,6 +972,7 @@ Message Information flexipage:fieldSection + flexipage_fieldSection2 @@ -905,6 +986,7 @@ Apex Class Information flexipage:fieldSection + flexipage_fieldSection3 1 AND 2 @@ -930,6 +1012,7 @@ Lightning Component Information flexipage:fieldSection + flexipage_fieldSection4 {!Record.OriginType__c} @@ -950,6 +1033,7 @@ Flow Information flexipage:fieldSection + flexipage_fieldSection5 {!Record.OriginType__c} @@ -970,6 +1054,7 @@ Exception Information flexipage:fieldSection + flexipage_fieldSection6 {!Record.HasException__c} @@ -990,6 +1075,7 @@ Database Result flexipage:fieldSection + flexipage_fieldSection7 {!Record.HasDatabaseResult__c} @@ -1010,6 +1096,7 @@ Related Record flexipage:fieldSection + flexipage_fieldSection8 {!Record.HasRecordJson__c} @@ -1030,11 +1117,13 @@ Limits flexipage:fieldSection + flexipage_fieldSection9 force:recordDetailPanelMobile + force_recordDetailPanelMobile main @@ -1056,6 +1145,7 @@ Topics forceChatter:topicsOnRecordWrapper + forceChatter_topicsOnRecordWrapper @@ -1073,6 +1163,7 @@ CARD force:relatedListSingleContainer + force_relatedListSingleContainer @@ -1082,6 +1173,7 @@ RECORD forceChatter:exposedFeed + forceChatter_exposedFeed sidebar diff --git a/nebula-logger/main/log-management/flexipages/LogEntryTagRecordPage.flexipage-meta.xml b/nebula-logger/main/log-management/flexipages/LogEntryTagRecordPage.flexipage-meta.xml index 3f5135309..70cb561de 100644 --- a/nebula-logger/main/log-management/flexipages/LogEntryTagRecordPage.flexipage-meta.xml +++ b/nebula-logger/main/log-management/flexipages/LogEntryTagRecordPage.flexipage-meta.xml @@ -24,6 +24,7 @@ 10 force:highlightsPanel + force_highlightsPanel header @@ -33,6 +34,7 @@ force:detailPanel + force_detailPanel main @@ -46,6 +48,7 @@ RECORD forceChatter:exposedFeed + forceChatter_exposedFeed sidebar diff --git a/nebula-logger/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml b/nebula-logger/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml index feb222b15..277c46930 100644 --- a/nebula-logger/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml +++ b/nebula-logger/main/log-management/flexipages/LogRecordPage.flexipage-meta.xml @@ -24,6 +24,7 @@ 10 force:highlightsPanel + force_highlightsPanel @@ -37,6 +38,7 @@ non-linear runtime_sales_pathassistant:pathAssistant + runtime_sales_pathassistant_pathAssistant header @@ -66,6 +68,7 @@ true force:relatedListSingleContainer + force_relatedListSingleContainer Facet-0f2e71a4-ac08-400c-8f11-6c6e44a085cb @@ -79,6 +82,7 @@ readonly Record.TransactionId__c + RecordTransactionId__cField @@ -88,6 +92,7 @@ readonly Record.StartTime__c + RecordStartTime__cField @@ -97,6 +102,7 @@ readonly Record.SystemModeSummary__c + RecordSystemModeSummary__cField @@ -106,6 +112,7 @@ readonly Record.TotalLimitsCpuTimeUsed__c + RecordTotalLimitsCpuTimeUsed__cField Facet-d581561a-9af6-472b-bf5b-f191cbaa0836 @@ -119,6 +126,7 @@ readonly Record.TotalLogEntries__c + RecordTotalLogEntries__cField @@ -128,6 +136,7 @@ readonly Record.TotalERRORLogEntries__c + RecordTotalERRORLogEntries__cField @@ -137,6 +146,7 @@ readonly Record.TotalWARNLogEntries__c + RecordTotalWARNLogEntries__cField @@ -146,6 +156,7 @@ readonly Record.ParentLog__c + RecordParentLog__cField Facet-af147cb3-e6b1-4ef7-a00b-d4746d5a1c90 @@ -159,6 +170,7 @@ Facet-d581561a-9af6-472b-bf5b-f191cbaa0836 flexipage:column + flexipage_column @@ -168,6 +180,7 @@ Facet-af147cb3-e6b1-4ef7-a00b-d4746d5a1c90 flexipage:column + flexipage_column2 Facet-bd93b6fa-7edb-4404-9635-26fa1ec10da5 @@ -181,6 +194,7 @@ readonly Record.OwnerId + RecordOwnerIdField @@ -190,6 +204,7 @@ readonly Record.Priority__c + RecordPriority__cField @@ -199,6 +214,7 @@ readonly Record.Status__c + RecordStatus__cField @@ -208,6 +224,7 @@ readonly Record.Scenario__c + RecordScenario__cField @@ -217,6 +234,7 @@ readonly Record.Issue__c + RecordIssue__cField @@ -226,6 +244,7 @@ readonly Record.Comments__c + RecordComments__cField Facet-5847b03d-2740-46a4-81cd-e39ffebaf306 @@ -239,6 +258,7 @@ readonly Record.IsClosed__c + RecordIsClosed__cField @@ -248,6 +268,7 @@ readonly Record.IsResolved__c + RecordIsResolved__cField @@ -257,6 +278,7 @@ readonly Record.ClosedBy__c + RecordClosedBy__cField @@ -266,6 +288,7 @@ readonly Record.ClosedDate__c + RecordClosedDate__cField @@ -275,6 +298,7 @@ readonly Record.LogRetentionDate__c + RecordLogRetentionDate__cField Facet-0d174e01-17f8-4c93-8f5a-8983346600f8 @@ -288,6 +312,7 @@ Facet-5847b03d-2740-46a4-81cd-e39ffebaf306 flexipage:column + flexipage_column3 @@ -297,6 +322,7 @@ Facet-0d174e01-17f8-4c93-8f5a-8983346600f8 flexipage:column + flexipage_column4 Facet-45c75e70-6963-46be-859e-c1df0d4b5c08 @@ -310,6 +336,7 @@ readonly Record.LoggedByUsernameLink__c + RecordLoggedByUsernameLink__cField @@ -319,6 +346,7 @@ readonly Record.UserLoggingLevel__c + RecordUserLoggingLevel__cField @@ -328,6 +356,7 @@ readonly Record.ProfileLink__c + RecordProfileLink__cField @@ -337,6 +366,7 @@ readonly Record.UserRoleLink__c + RecordUserRoleLink__cField @@ -346,6 +376,7 @@ readonly Record.UserType__c + RecordUserType__cField Facet-c9a75c95-cc0f-4cad-88ea-3ad05e1d03ef @@ -359,6 +390,7 @@ readonly Record.Locale__c + RecordLocale__cField @@ -368,6 +400,7 @@ readonly Record.TimeZoneName__c + RecordTimeZoneName__cField @@ -377,6 +410,7 @@ readonly Record.UserLicenseId__c + RecordUserLicenseId__cField @@ -386,6 +420,7 @@ readonly Record.UserLicenseName__c + RecordUserLicenseName__cField @@ -395,6 +430,7 @@ readonly Record.UserLicenseDefinitionKey__c + RecordUserLicenseDefinitionKey__cField Facet-5f51eb27-d6d6-40bf-aece-d3dedddd86c3 @@ -408,6 +444,7 @@ Facet-c9a75c95-cc0f-4cad-88ea-3ad05e1d03ef flexipage:column + flexipage_column5 @@ -417,6 +454,7 @@ Facet-5f51eb27-d6d6-40bf-aece-d3dedddd86c3 flexipage:column + flexipage_column6 Facet-12145474-d012-4654-ba48-4100dbbbc893 @@ -430,6 +468,7 @@ readonly Record.SessionId__c + RecordSessionId__cField @@ -439,6 +478,7 @@ readonly Record.SessionType__c + RecordSessionType__cField @@ -448,6 +488,7 @@ readonly Record.SessionSecurityLevel__c + RecordSessionSecurityLevel__cField @@ -457,6 +498,7 @@ readonly Record.SourceIp__c + RecordSourceIp__cField @@ -466,6 +508,7 @@ readonly Record.LoginHistoryId__c + RecordLoginHistoryId__cField @@ -475,6 +518,7 @@ readonly Record.LoginType__c + RecordLoginType__cField Facet-a13e63e8-930f-4be1-94cf-3e93d3875283 @@ -488,6 +532,7 @@ readonly Record.LoginApplication__c + RecordLoginApplication__cField @@ -497,6 +542,7 @@ readonly Record.LoginPlatform__c + RecordLoginPlatform__cField @@ -506,6 +552,7 @@ readonly Record.LoginBrowser__c + RecordLoginBrowser__cField @@ -515,6 +562,7 @@ readonly Record.ThemeDisplayed__c + RecordThemeDisplayed__cField @@ -524,6 +572,7 @@ readonly Record.LogoutUrl__c + RecordLogoutUrl__cField Facet-8166c7e7-f142-4051-8cf3-1c42335d7402 @@ -537,6 +586,7 @@ Facet-a13e63e8-930f-4be1-94cf-3e93d3875283 flexipage:column + flexipage_column7 @@ -546,6 +596,7 @@ Facet-8166c7e7-f142-4051-8cf3-1c42335d7402 flexipage:column + flexipage_column8 Facet-9fb0fd0b-69be-44f7-8c04-fb654709fe28 @@ -559,6 +610,7 @@ readonly Record.NetworkId__c + RecordNetworkId__cField @@ -568,6 +620,7 @@ readonly Record.NetworkName__c + RecordNetworkName__cField @@ -577,6 +630,7 @@ readonly Record.NetworkUrlPathPrefix__c + RecordNetworkUrlPathPrefix__cField Facet-8be71933-38d1-4afa-adff-fffceb6867e1 @@ -590,6 +644,7 @@ readonly Record.NetworkSelfRegistrationUrl__c + RecordNetworkSelfRegistrationUrl__cField @@ -599,6 +654,7 @@ readonly Record.NetworkLoginUrl__c + RecordNetworkLoginUrl__cField @@ -608,6 +664,7 @@ readonly Record.NetworkLogoutUrl__c + RecordNetworkLogoutUrl__cField Facet-f457131f-2dab-408e-9965-d730594b7ea2 @@ -621,6 +678,7 @@ Facet-8be71933-38d1-4afa-adff-fffceb6867e1 flexipage:column + flexipage_column9 @@ -630,6 +688,7 @@ Facet-f457131f-2dab-408e-9965-d730594b7ea2 flexipage:column + flexipage_column10 Facet-f8d82d02-dbf4-468f-aae1-45cfb6763435 @@ -643,6 +702,7 @@ readonly Record.LoggerVersionNumber__c + RecordLoggerVersionNumber__cField @@ -652,6 +712,7 @@ readonly Record.OrganizationId__c + RecordOrganizationId__cField @@ -661,6 +722,7 @@ readonly Record.OrganizationName__c + RecordOrganizationName__cField @@ -670,6 +732,7 @@ readonly Record.OrganizationType__c + RecordOrganizationType__cField @@ -679,6 +742,7 @@ readonly Record.OrganizationNamespacePrefix__c + RecordOrganizationNamespacePrefix__cField @@ -688,6 +752,7 @@ readonly Record.OrganizationDomainUrl__c + RecordOrganizationDomainUrl__cField Facet-c4a1f400-d677-4197-9c0c-60bb1e5b426d @@ -701,6 +766,7 @@ readonly Record.OrganizationEnvironmentType__c + RecordOrganizationEnvironmentType__cField @@ -710,6 +776,7 @@ readonly Record.OrganizationInstanceName__c + RecordOrganizationInstanceName__cField @@ -719,6 +786,7 @@ readonly Record.ApiVersion__c + RecordApiVersion__cField @@ -728,6 +796,7 @@ readonly Record.ApiReleaseVersion__c + RecordApiReleaseVersion__cField @@ -737,6 +806,7 @@ readonly Record.ApiReleaseNumber__c + RecordApiReleaseNumber__cField Facet-7a49dd50-62e1-43c4-a95b-81a04f2e4a8e @@ -750,6 +820,7 @@ Facet-c4a1f400-d677-4197-9c0c-60bb1e5b426d flexipage:column + flexipage_column11 @@ -759,6 +830,7 @@ Facet-7a49dd50-62e1-43c4-a95b-81a04f2e4a8e flexipage:column + flexipage_column12 Facet-d7efb447-a626-4612-8219-5b554c751159 @@ -776,6 +848,7 @@ Information flexipage:fieldSection + flexipage_fieldSection @@ -789,6 +862,7 @@ Log Management flexipage:fieldSection + flexipage_fieldSection2 @@ -802,6 +876,7 @@ User Details flexipage:fieldSection + flexipage_fieldSection3 @@ -815,6 +890,7 @@ Session Details flexipage:fieldSection + flexipage_fieldSection4 {!Record.SessionId__c} @@ -834,6 +910,7 @@ Experience Cloud Site Details flexipage:fieldSection + flexipage_fieldSection5 {!Record.NetworkId__c} @@ -853,11 +930,13 @@ Organization Details flexipage:fieldSection + flexipage_fieldSection6 force:recordDetailPanelMobile + force_recordDetailPanelMobile Facet-82b9e667-1aa4-42ed-8a09-ac611351ece9 @@ -887,6 +966,7 @@ true force:relatedListSingleContainer + force_relatedListSingleContainer2 Facet-f428f9bd-8335-4c6e-994c-9fb022741a70 @@ -916,6 +996,7 @@ true force:relatedListSingleContainer + force_relatedListSingleContainer3 Facet-0bb71d38-e0b0-4931-838e-b2254d40c2ea @@ -929,6 +1010,7 @@ RECORD forceChatter:exposedFeed + forceChatter_exposedFeed Facet-cd3bf9c9-7895-4537-a614-5e58e75317f2 @@ -950,6 +1032,7 @@ Log Entries flexipage:tab + customTab @@ -963,6 +1046,7 @@ Standard.Tab.detail flexipage:tab + detailTab @@ -976,6 +1060,7 @@ History flexipage:tab + customTab2 @@ -989,6 +1074,7 @@ Related Logs flexipage:tab + customTab3 @@ -1002,6 +1088,7 @@ Standard.Tab.collaborate flexipage:tab + collaborateTab Facet-4be58932-ea47-4516-80d6-14dedd7c1fc0 @@ -1023,6 +1110,7 @@ Topics forceChatter:topicsOnRecordWrapper + forceChatter_topicsOnRecordWrapper @@ -1032,6 +1120,7 @@ Facet-4be58932-ea47-4516-80d6-14dedd7c1fc0 flexipage:tabset + flexipage_tabset main diff --git a/nebula-logger/main/log-management/flexipages/LoggerConsoleUtilityBar.flexipage-meta.xml b/nebula-logger/main/log-management/flexipages/LoggerConsoleUtilityBar.flexipage-meta.xml index 7403be20a..c0f041ca8 100644 --- a/nebula-logger/main/log-management/flexipages/LoggerConsoleUtilityBar.flexipage-meta.xml +++ b/nebula-logger/main/log-management/flexipages/LoggerConsoleUtilityBar.flexipage-meta.xml @@ -4,6 +4,7 @@ console:history + console_history utilityItems diff --git a/nebula-logger/main/log-management/flexipages/LoggerTagRecordPage.flexipage-meta.xml b/nebula-logger/main/log-management/flexipages/LoggerTagRecordPage.flexipage-meta.xml index 8994b825c..5e8039e9f 100644 --- a/nebula-logger/main/log-management/flexipages/LoggerTagRecordPage.flexipage-meta.xml +++ b/nebula-logger/main/log-management/flexipages/LoggerTagRecordPage.flexipage-meta.xml @@ -24,6 +24,7 @@ 10 force:highlightsPanel + force_highlightsPanel header @@ -53,6 +54,7 @@ true force:relatedListSingleContainer + force_relatedListSingleContainer Facet-3dc4c83f-a25a-490d-9370-2bad02789b05 @@ -66,6 +68,7 @@ RECORD forceChatter:exposedFeed + forceChatter_exposedFeed Facet-2defa18d-1986-4223-bed9-14b2917856f4 @@ -87,6 +90,7 @@ Standard.Tab.relatedLists flexipage:tab + relatedListsTab @@ -100,6 +104,7 @@ Standard.Tab.feed flexipage:tab + feedTab Facet-67bbc836-1943-4c29-81cd-4434b0c30480 @@ -113,6 +118,7 @@ Facet-67bbc836-1943-4c29-81cd-4434b0c30480 flexipage:tabset + flexipage_tabset main diff --git a/nebula-logger/main/log-management/lwc/logEntryEventStream/__tests__/logEntryEventStream.test.js b/nebula-logger/main/log-management/lwc/logEntryEventStream/__tests__/logEntryEventStream.test.js index d423ba7b8..c91513aae 100644 --- a/nebula-logger/main/log-management/lwc/logEntryEventStream/__tests__/logEntryEventStream.test.js +++ b/nebula-logger/main/log-management/lwc/logEntryEventStream/__tests__/logEntryEventStream.test.js @@ -112,7 +112,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="logging-level-filter"]'); + const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="loggingLevelFilter"]'); loggingLevelFilterDropdown.value = loggingLevels.DEBUG; loggingLevelFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -136,7 +136,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="logging-level-filter"]'); + const loggingLevelFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="loggingLevelFilter"]'); loggingLevelFilterDropdown.value = loggingLevels.DEBUG; loggingLevelFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -159,7 +159,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="origin-type-filter"]'); + const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="originTypeFilter"]'); originTypeFilterDropdown.value = 'Flow'; originTypeFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -182,7 +182,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="origin-type-filter"]'); + const originTypeFilterDropdown = element.shadowRoot.querySelector('lightning-combobox[data-id="originTypeFilter"]'); originTypeFilterDropdown.value = 'Flow'; originTypeFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -204,7 +204,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="origin-location-filter"]'); + const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="originLocationFilter"]'); originLocationFilterDropdown.value = 'SomeClass.someMethod'; originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -227,7 +227,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="origin-location-filter"]'); + const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="originLocationFilter"]'); originLocationFilterDropdown.value = 'SomeClass.someMethod'; originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -249,7 +249,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="logged-by-filter"]'); + const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="loggedByFilter"]'); originLocationFilterDropdown.value = 'some.person@test.com'; originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -272,7 +272,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="logged-by-filter"]'); + const originLocationFilterDropdown = element.shadowRoot.querySelector('lightning-input[data-id="loggedByFilter"]'); originLocationFilterDropdown.value = 'some.person@test.com'; originLocationFilterDropdown.dispatchEvent(new CustomEvent('change')); @@ -288,13 +288,13 @@ describe('LogEntryEventStream tests', () => { const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); expect(eventStreamDiv.textContent).toBeFalsy(); }); - it('includes matching log entry event for message filter', async () => { + it('includes matching log entry event using string for message filter', async () => { const element = createElement('log-entry-event-stream', { is: LogEntryEventStream }); document.body.appendChild(element); await Promise.resolve(); - const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="message-filter"]'); + const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); messageFilterTextarea.value = 'matching text'; messageFilterTextarea.dispatchEvent(new CustomEvent('change')); @@ -317,7 +317,7 @@ describe('LogEntryEventStream tests', () => { }); document.body.appendChild(element); await Promise.resolve(); - const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="message-filter"]'); + const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); messageFilterTextarea.value = 'non-matching text'; messageFilterTextarea.dispatchEvent(new CustomEvent('change')); @@ -333,4 +333,28 @@ describe('LogEntryEventStream tests', () => { const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); expect(eventStreamDiv.textContent).toBeFalsy(); }); + + it('includes matching log entry event using regex for message filter', async () => { + const element = createElement('log-entry-event-stream', { + is: LogEntryEventStream + }); + document.body.appendChild(element); + await Promise.resolve(); + + const messageFilterTextarea = element.shadowRoot.querySelector('lightning-textarea[data-id="messageFilter"]'); + messageFilterTextarea.value = 'Something.+? blah$'; + messageFilterTextarea.dispatchEvent(new CustomEvent('change')); + + const matchingLogEntryEvent = { ...mockLogEntryEventTemplate }; + matchingLogEntryEvent.Message__c = 'Something, something, something, beep boop beep!!!!!!!%@#$!%, blah, blah, blah'; + await jestMockPublish('/event/LogEntryEvent__e', { + data: { + payload: matchingLogEntryEvent + } + }); + + const expectedStreamText = getPlatformEventText(matchingLogEntryEvent); + const eventStreamDiv = element.shadowRoot.querySelector('.event-stream'); + expect(eventStreamDiv.textContent).toBe(expectedStreamText); + }); }); diff --git a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html index 700a9baf3..86d50e7c6 100644 --- a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html +++ b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.html @@ -26,39 +26,46 @@ value={maxEvents} > + diff --git a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js index dcd31e2c0..beff92548 100644 --- a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js +++ b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js @@ -2,6 +2,7 @@ import { LightningElement } from 'lwc'; import { isEmpEnabled, subscribe, unsubscribe } from 'lightning/empApi'; export default class LogEntryEventStream extends LightningElement { + unfilteredEvents = []; logEntryEvents = []; isExpanded = false; isStreamEnabled = true; @@ -12,13 +13,19 @@ export default class LogEntryEventStream extends LightningElement { messageFilter; originTypeFilter; originLocationFilter; + scenarioFilter; maxEvents = 50; _channel = '/event/LogEntryEvent__e'; // TODO need to support namespace in managed package _subscription = {}; get title() { - return this.logEntryEvents.length + ' Log Entry Events'; + let logEntryString = ' Log Entry Events'; + let startingTitle = this.logEntryEvents.length + logEntryString; + if (this.unfilteredEvents.length !== this.logEntryEvents.length) { + startingTitle = this.logEntryEvents.length + ' matching results out of ' + this.unfilteredEvents.length + logEntryString; + } + return startingTitle; } get streamButtonVariant() { @@ -59,7 +66,7 @@ export default class LogEntryEventStream extends LightningElement { } createSubscription() { - subscribe(this._channel, -1, this.subscriptionCallback.bind(this)).then(response => { + subscribe(this._channel, -1, this.subscriptionCallback).then(response => { this._subscription = response; }); } @@ -68,24 +75,9 @@ export default class LogEntryEventStream extends LightningElement { unsubscribe(this._subscription); } - handleLoggingLevelFilterChange(event) { - this.loggingLevelFilter = event.target.value; - } - - handleOriginTypeFilterChange(event) { - this.originTypeFilter = event.target.value; - } - - handleOriginLocationFilterChange(event) { - this.originLocationFilter = event.target.value; - } - - handleLoggedByFilterChange(event) { - this.loggedByFilter = event.target.value; - } - - handleMessageFilterChange(event) { - this.messageFilter = event.target.value; + handleFilterChange(event) { + this[event.target.dataset.id] = event.target.value; + this._filterEvents(); } handleMaxEventsChange(event) { @@ -94,6 +86,7 @@ export default class LogEntryEventStream extends LightningElement { onClear() { this.logEntryEvents = []; + this.unfilteredEvents = []; } // onToggleExpand() { @@ -104,44 +97,38 @@ export default class LogEntryEventStream extends LightningElement { onToggleStream() { this.isStreamEnabled = !this.isStreamEnabled; - if (this.isStreamEnabled) { - this.createSubscription(); - } else { - this.cancelSubscription(); - } + // eslint-disable-next-line + this.isStreamEnabled ? this.createSubscription() : this.cancelSubscription(); } - subscriptionCallback(response) { + subscriptionCallback = response => { const logEntryEvent = response.data.payload; // As of API v52.0 (Summer '21), platform events have a unique field, EventUUID // but it doesn't seem to be populated via empApi, so use a synthetic key instead logEntryEvent.key = logEntryEvent.TransactionId__c + '__' + logEntryEvent.TransactionEntryNumber__c; + this.unfilteredEvents.unshift(logEntryEvent); + this._filterEvents(); + }; - const updatedLogEntryEvents = [...this.logEntryEvents]; - - if ( - this._meetsLoggedByFilter(logEntryEvent) && - this._meetsLoggingLevelFilter(logEntryEvent) && - this._meetsMessageFilter(logEntryEvent) && - this._meetsOriginLocationFilter(logEntryEvent) && - this._meetsOriginTypeFilter(logEntryEvent) - ) { - updatedLogEntryEvents.unshift(logEntryEvent); + // Private functions + _filterEvents() { + while (this.unfilteredEvents.length > this.maxEvents) { + this.unfilteredEvents.pop(); } - while (updatedLogEntryEvents.length > this.maxEvents) { - updatedLogEntryEvents.pop(); - } - this.logEntryEvents = updatedLogEntryEvents; + this.logEntryEvents = this.unfilteredEvents.filter( + logEntryEvent => + this._meetsLoggedByFilter(logEntryEvent) && + this._meetsLoggingLevelFilter(logEntryEvent) && + this._meetsMessageFilter(logEntryEvent) && + this._meetsOriginLocationFilter(logEntryEvent) && + this._meetsOriginTypeFilter(logEntryEvent) && + this._meetsScenarioFilter(logEntryEvent) + ); } - // Private functions _meetsLoggedByFilter(logEntryEvent) { - let matches = false; - if (!this.loggedByFilter || logEntryEvent.LoggedByUsername__c.includes(this.loggedByFilter)) { - matches = true; - } - return matches; + return this._matchesTextFilter(this.loggedByFilter, logEntryEvent.LoggedByUsername__c); } _meetsLoggingLevelFilter(logEntryEvent) { @@ -153,27 +140,24 @@ export default class LogEntryEventStream extends LightningElement { } _meetsMessageFilter(logEntryEvent) { - // TODO support for regex searches in Message__c - let matches = false; - if (!this.messageFilter || logEntryEvent.Message__c.includes(this.messageFilter)) { - matches = true; - } - return matches; + return this._matchesTextFilter(this.messageFilter, logEntryEvent.Message__c); } _meetsOriginLocationFilter(logEntryEvent) { - // TODO support for regex searches in OriginLocation__c - let matches = false; - if (!this.originLocationFilter || logEntryEvent.OriginLocation__c.includes(this.originLocationFilter)) { - matches = true; - } - return matches; + return this._matchesTextFilter(this.originLocationFilter, logEntryEvent.OriginLocation__c); } _meetsOriginTypeFilter(logEntryEvent) { - // TODO support for regex searches in Message__c + return this._matchesTextFilter(this.originTypeFilter, logEntryEvent.OriginType__c); + } + + _meetsScenarioFilter(logEntryEvent) { + return this._matchesTextFilter(this.scenarioFilter, logEntryEvent.Scenario__c); + } + + _matchesTextFilter(filterCriteria = '', text = '') { let matches = false; - if (!this.originTypeFilter || logEntryEvent.OriginType__c === this.originTypeFilter) { + if (!filterCriteria || text.includes(filterCriteria) || text.match(filterCriteria)) { matches = true; } return matches; diff --git a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js-meta.xml b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js-meta.xml index 52a807421..cec768d25 100644 --- a/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js-meta.xml +++ b/nebula-logger/main/log-management/lwc/logEntryEventStream/logEntryEventStream.js-meta.xml @@ -1,6 +1,6 @@ - 52.0 + 53.0 false Log Entry Event Stream diff --git a/nebula-logger/main/log-management/lwc/logViewer/logViewer.js-meta.xml b/nebula-logger/main/log-management/lwc/logViewer/logViewer.js-meta.xml index 497e98000..e4e51b24e 100644 --- a/nebula-logger/main/log-management/lwc/logViewer/logViewer.js-meta.xml +++ b/nebula-logger/main/log-management/lwc/logViewer/logViewer.js-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 true diff --git a/nebula-logger/main/log-management/lwc/relatedLogEntries/__tests__/data/getQueryResult.json b/nebula-logger/main/log-management/lwc/relatedLogEntries/__tests__/data/getQueryResult.json index be8e6a2e0..aac3a2195 100644 --- a/nebula-logger/main/log-management/lwc/relatedLogEntries/__tests__/data/getQueryResult.json +++ b/nebula-logger/main/log-management/lwc/relatedLogEntries/__tests__/data/getQueryResult.json @@ -3,9 +3,9 @@ "tabIcon": "custom:custom83", "records": [ { - "attributes": { "type": "LogEntry__c", "url": "/services/data/v52.0/sobjects/LogEntry__c/a0054000004OazXAAS" }, + "attributes": { "type": "LogEntry__c", "url": "/services/data/v53.0/sobjects/LogEntry__c/a0054000004OazXAAS" }, "Log__r": { - "attributes": { "type": "Log__c", "url": "/services/data/v52.0/sobjects/Log__c/a0154000007ksDlAAI" }, + "attributes": { "type": "Log__c", "url": "/services/data/v53.0/sobjects/Log__c/a0154000007ksDlAAI" }, "Id": "a0154000007ksDlAAI", "Name": "Log-001429" }, @@ -18,9 +18,9 @@ "Name": "a0054000004OazX" }, { - "attributes": { "type": "LogEntry__c", "url": "/services/data/v52.0/sobjects/LogEntry__c/a0054000004OazYAAS" }, + "attributes": { "type": "LogEntry__c", "url": "/services/data/v53.0/sobjects/LogEntry__c/a0054000004OazYAAS" }, "Log__r": { - "attributes": { "type": "Log__c", "url": "/services/data/v52.0/sobjects/Log__c/a0154000007ksDlAAI" }, + "attributes": { "type": "Log__c", "url": "/services/data/v53.0/sobjects/Log__c/a0154000007ksDlAAI" }, "Id": "a0154000007ksDlAAI", "Name": "Log-001429" }, @@ -33,9 +33,9 @@ "Name": "a0054000004OazY" }, { - "attributes": { "type": "LogEntry__c", "url": "/services/data/v52.0/sobjects/LogEntry__c/a0054000004Ob2gAAC" }, + "attributes": { "type": "LogEntry__c", "url": "/services/data/v53.0/sobjects/LogEntry__c/a0054000004Ob2gAAC" }, "Log__r": { - "attributes": { "type": "Log__c", "url": "/services/data/v52.0/sobjects/Log__c/a0154000007ksGuAAI" }, + "attributes": { "type": "Log__c", "url": "/services/data/v53.0/sobjects/Log__c/a0154000007ksGuAAI" }, "Id": "a0154000007ksGuAAI", "Name": "Log-001430" }, @@ -48,9 +48,9 @@ "Name": "a0054000004Ob2g" }, { - "attributes": { "type": "LogEntry__c", "url": "/services/data/v52.0/sobjects/LogEntry__c/a0054000004Ob2hAAC" }, + "attributes": { "type": "LogEntry__c", "url": "/services/data/v53.0/sobjects/LogEntry__c/a0054000004Ob2hAAC" }, "Log__r": { - "attributes": { "type": "Log__c", "url": "/services/data/v52.0/sobjects/Log__c/a0154000007ksGuAAI" }, + "attributes": { "type": "Log__c", "url": "/services/data/v53.0/sobjects/Log__c/a0154000007ksGuAAI" }, "Id": "a0154000007ksGuAAI", "Name": "Log-001430" }, diff --git a/nebula-logger/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js-meta.xml b/nebula-logger/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js-meta.xml index d43538603..7a734fded 100644 --- a/nebula-logger/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js-meta.xml +++ b/nebula-logger/main/log-management/lwc/relatedLogEntries/relatedLogEntries.js-meta.xml @@ -2,7 +2,7 @@ Related Log Entries Displays a related list of log entries for the current record. - 52.0 + 53.0 true lightning__RecordPage diff --git a/nebula-logger/main/log-management/pages/LogMassDelete.page-meta.xml b/nebula-logger/main/log-management/pages/LogMassDelete.page-meta.xml index 57bebd5a3..54d894dd5 100644 --- a/nebula-logger/main/log-management/pages/LogMassDelete.page-meta.xml +++ b/nebula-logger/main/log-management/pages/LogMassDelete.page-meta.xml @@ -1,6 +1,6 @@ - 52.0 + 53.0 false false diff --git a/nebula-logger/main/log-management/triggers/Log.trigger-meta.xml b/nebula-logger/main/log-management/triggers/Log.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger/main/log-management/triggers/Log.trigger-meta.xml +++ b/nebula-logger/main/log-management/triggers/Log.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/triggers/LogEntry.trigger-meta.xml b/nebula-logger/main/log-management/triggers/LogEntry.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger/main/log-management/triggers/LogEntry.trigger-meta.xml +++ b/nebula-logger/main/log-management/triggers/LogEntry.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/triggers/LogEntryEvent.trigger-meta.xml b/nebula-logger/main/log-management/triggers/LogEntryEvent.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger/main/log-management/triggers/LogEntryEvent.trigger-meta.xml +++ b/nebula-logger/main/log-management/triggers/LogEntryEvent.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/triggers/LogEntryTag.trigger-meta.xml b/nebula-logger/main/log-management/triggers/LogEntryTag.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger/main/log-management/triggers/LogEntryTag.trigger-meta.xml +++ b/nebula-logger/main/log-management/triggers/LogEntryTag.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/log-management/triggers/LoggerTag.trigger-meta.xml b/nebula-logger/main/log-management/triggers/LoggerTag.trigger-meta.xml index 63037f969..53f9ab459 100644 --- a/nebula-logger/main/log-management/triggers/LoggerTag.trigger-meta.xml +++ b/nebula-logger/main/log-management/triggers/LoggerTag.trigger-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/ComponentLogger.cls b/nebula-logger/main/logger-engine/classes/ComponentLogger.cls index a531abc18..ed1076e09 100644 --- a/nebula-logger/main/logger-engine/classes/ComponentLogger.cls +++ b/nebula-logger/main/logger-engine/classes/ComponentLogger.cls @@ -26,11 +26,14 @@ public inherited sharing class ComponentLogger { /** * @description saveComponentLogEntries Saves log entries created via lwc or aura components * @param componentLogEntries The list of `ComponentLogEntry` objects to save via `Logger` + * @param saveMethodName String name of the instance of Logger.SaveMethod to use when saving. + * When null, the value of `Logger.getSaveMethod()` will be used. * @return return The transaction ID (based on `Logger.getTransactionId())` */ @AuraEnabled - public static String saveComponentLogEntries(List componentLogEntries) { + public static String saveComponentLogEntries(List componentLogEntries, String saveMethodName) { try { + Logger.SaveMethod saveMethod = Logger.getSaveMethod(); for (ComponentLogEntry componentLogEntry : componentLogEntries) { Logger.setScenario(componentLogEntry.scenario); LoggingLevel entryLoggingLevel = Logger.getLoggingLevel(componentLogEntry.loggingLevel); @@ -43,7 +46,10 @@ public inherited sharing class ComponentLogger { setComponentErrorDetails(logEntryEventBuilder, componentLogEntry.error); setStackTraceDetails(logEntryEventBuilder, componentLogEntry.stack); } - Logger.saveLog(); + if (String.isNotBlank(saveMethodName) == true) { + saveMethod = Logger.SaveMethod.valueOf(saveMethodName); + } + Logger.saveLog(saveMethod); return Logger.getTransactionId(); } catch (Exception apexException) { throw new AuraHandledException(apexException.getMessage()); @@ -124,6 +130,12 @@ public inherited sharing class ComponentLogger { * @description A DTO object used for passing `LoggerSettings__c` details to lightning components */ public class ComponentLoggerSettings { + /** + * @description Indicates the save method that will be used by default if no other save method is specified, based on `LoggerSettings__c.DefaultSaveMethod__c` + */ + @AuraEnabled + public String defaultSaveMethodName { get; set; } + /** * @description Indicates if logging is enabled for the current user, based on `LoggerSettings__c.IsEnabled__c` */ @@ -149,6 +161,7 @@ public inherited sharing class ComponentLogger { public ComponentLoggingLevel userLoggingLevel { get; set; } private ComponentLoggerSettings() { + this.defaultSaveMethodName = Logger.getSaveMethod().name(); this.isEnabled = Logger.getUserSettings().IsEnabled__c; this.isConsoleLoggingEnabled = Logger.getUserSettings().IsComponentConsoleLoggingEnabled__c; this.supportedLoggingLevels = getSupportedLoggingLevels(); diff --git a/nebula-logger/main/logger-engine/classes/ComponentLogger.cls-meta.xml b/nebula-logger/main/logger-engine/classes/ComponentLogger.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/ComponentLogger.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/ComponentLogger.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls b/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls index f3d828080..f0219cbba 100644 --- a/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls +++ b/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls @@ -15,7 +15,7 @@ @SuppressWarnings('PMD.AvoidGlobalModifier') global inherited sharing class FlowCollectionLogEntry { /** - * @description The name of the Flow creating the log entry. + * @description The API name of the Flow creating the log entry. * Due to Salesforce limitations, this cannot be automatically determined */ @InvocableVariable(required=true label='Flow API Name') @@ -45,6 +45,12 @@ global inherited sharing class FlowCollectionLogEntry { @InvocableVariable(required=false label='(Optional) Save Log') global Boolean saveLog = false; + /** + * @description Optionally choose the save method to use when 'Save Log' is true + */ + @InvocableVariable(required=false label='(Optional) Save Method') + global String saveMethodName; + /** * @description Optionally specify a logging level - the default is 'DEBUG' */ diff --git a/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls-meta.xml b/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/FlowCollectionLogEntry.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls b/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls index 041236faa..da1708fa3 100644 --- a/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls +++ b/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls @@ -15,14 +15,14 @@ @SuppressWarnings('PMD.AvoidGlobalModifier') global inherited sharing class FlowLogEntry { /** - * @description The name of the Flow creating the log entry. + * @description The API name of the Flow creating the log entry. * Due to Salesforce limitations, this cannot be automatically determined. */ @InvocableVariable(required=true label='Flow API Name') global String flowName; /** - * @description The message to log. + * @description The message to log */ @InvocableVariable(required=true label='Log Entry Message') global String message; @@ -34,11 +34,17 @@ global inherited sharing class FlowLogEntry { global String faultMessage; /** - * @description Optionally choose to save any pending log entries. + * @description Optionally choose to save any pending log entries */ @InvocableVariable(required=false label='(Optional) Save Log') global Boolean saveLog; + /** + * @description Optionally choose the save method to use when 'Save Log' is true + */ + @InvocableVariable(required=false label='(Optional) Save Method') + global String saveMethodName; + /** * @description Optionally relate the log entry to a particular record ID */ diff --git a/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls-meta.xml b/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/FlowLogEntry.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/FlowLogger.cls b/nebula-logger/main/logger-engine/classes/FlowLogger.cls index 94ac89a20..5decacc91 100644 --- a/nebula-logger/main/logger-engine/classes/FlowLogger.cls +++ b/nebula-logger/main/logger-engine/classes/FlowLogger.cls @@ -26,12 +26,12 @@ public inherited sharing class FlowLogger { // Public member variables - all other Flow classes should duplicate these public variables /** - * @description name of the flow. + * @description API name of the flow */ public String flowName; /** - * @description General message to log. + * @description General message to log */ public String message; @@ -41,31 +41,36 @@ public inherited sharing class FlowLogger { public String faultMessage; /** - * @description String containing the logging level. + * @description String name of the entry's logging level */ public String loggingLevelName; /** - * @description Optionally specify the name to use for the current transaction's scenario + * @description Optionally specify the scenario to use for the current transaction */ @InvocableVariable(required=false label='(Optional) Scenario') public String scenario; /** - * @description String of tags / topics. + * @description Comma-separated string of tags */ public String tagsString; /** - * @description List of tags / topics. + * @description List of tags / topics */ public List topics; // TODO: deprecated, remove in a future release /** - * @description boolean used to determine if logs are saved to Salesforce. + * @description Boolean used to determine if logs are saved to Salesforce */ public Boolean saveLog = false; + /** + * @description String name of the instance of Logger.SaveMethod to use when 'Save Log' == true + */ + public String saveMethodName; + /** * @description timestamp of the log */ @@ -77,8 +82,8 @@ public inherited sharing class FlowLogger { private LogEntryEvent__e logEntryEvent; /** - * @description Adds the logger to the buffer. - * @return An instance of LogEntryEventBuilder. + * @description Adds the logger to the buffer + * @return An instance of LogEntryEventBuilder */ public LogEntryEventBuilder addToLoggerBuffer() { if (this.logEntryEventBuilder != null) { @@ -130,16 +135,20 @@ public inherited sharing class FlowLogger { */ public static List addEntries(List flowEntries) { Boolean saveLog = false; + Logger.SaveMethod saveMethod = Logger.getSaveMethod(); for (LogEntry flowEntry : flowEntries) { flowEntry.addToLoggerBuffer(); if (flowEntry.saveLog == true) { saveLog = flowEntry.saveLog; + if (String.isNotBlank(flowEntry.saveMethodName) == true) { + saveMethod = Logger.SaveMethod.valueOf(flowEntry.saveMethodName); + } } } if (saveLog == true) { - Logger.saveLog(); + Logger.saveLog(saveMethod); } // Event though it's the same transaction ID, Salesforce expects the returned list... diff --git a/nebula-logger/main/logger-engine/classes/FlowLogger.cls-meta.xml b/nebula-logger/main/logger-engine/classes/FlowLogger.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/FlowLogger.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/FlowLogger.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls b/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls index 6baf0acb3..b667745ea 100644 --- a/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls +++ b/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls @@ -15,7 +15,7 @@ @SuppressWarnings('PMD.AvoidGlobalModifier') global inherited sharing class FlowRecordLogEntry { /** - * @description The name of the Flow creating the log entry. + * @description The API name of the Flow creating the log entry. * Due to Salesforce limitations, this cannot be automatically determined */ @InvocableVariable(required=true label='Flow API Name') @@ -44,6 +44,12 @@ global inherited sharing class FlowRecordLogEntry { @InvocableVariable(required=false label='(Optional) Save Log') global Boolean saveLog = false; + /** + * @description Optionally choose the save method to use when 'Save Log' is true + */ + @InvocableVariable(required=false label='(Optional) Save Method') + global String saveMethodName; + /** * @description Optionally specify a logging level - the default is 'DEBUG' */ diff --git a/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls-meta.xml b/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/FlowRecordLogEntry.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls b/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls index d880a2afd..9d635359a 100644 --- a/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls +++ b/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls @@ -760,7 +760,7 @@ global with sharing class LogEntryEventBuilder { // Serializing any SObject w/ an ID will include the API version // So, use UserInfo.getUserId() to create the current user's record without querying // Then parse the JSON to get the API version - // Expected JSON: {"attributes":{"type":"User","url":"/services/data/v52.0/sobjects/User/005J000000AugnYIAR"} + // Expected JSON: {"attributes":{"type":"User","url":"/services/data/v53.0/sobjects/User/005J000000AugnYIAR"} String userJson = JSON.serialize(new User(Id = UserInfo.getUserId())); return userJson.substringAfter('/data/').substringBefore('/sobjects/User'); } diff --git a/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls-meta.xml b/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/LogEntryEventBuilder.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/LogMessage.cls-meta.xml b/nebula-logger/main/logger-engine/classes/LogMessage.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/LogMessage.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/LogMessage.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/classes/Logger.cls b/nebula-logger/main/logger-engine/classes/Logger.cls index a917f80dc..d507f9f84 100644 --- a/nebula-logger/main/logger-engine/classes/Logger.cls +++ b/nebula-logger/main/logger-engine/classes/Logger.cls @@ -13,7 +13,7 @@ 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.6.12'; + private static final String CURRENT_VERSION_NUMBER = 'v4.6.13'; private static final LoggingLevel DEFAULT_LOGGING_LEVEL = LoggingLevel.DEBUG; private static final List LOG_ENTRIES_BUFFER = new List(); @TestVisible @@ -2476,6 +2476,14 @@ global with sharing class Logger { SCENARIO_TO_MOCK_SCENARIO_RULE.put(scenarioRule.Scenario__c, scenarioRule); } + /** + * @description Returns the default save method used when calling saveLog() - set via LoggerSettings__c or by calling setSaveMethod(SaveMethod saveMethod) + * @return The enum value of Logger.SaveMethod to use for any calls to saveLog() in the current transaction + */ + global static SaveMethod getSaveMethod() { + return transactionSaveMethod; + } + /** * @description Sets the default save method used when calling saveLog() - any subsequent calls to saveLog() will use the specified save method * @param saveMethod The enum value of Logger.SaveMethod to use for any other calls to saveLog() in the current transaction @@ -2793,7 +2801,7 @@ global with sharing class Logger { // Inner class for saving log entries via the REST API (using the current user's session ID) private class RestApiSaver { - private final String baseURL = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/data/v52.0'; + private final String baseURL = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/data/v53.0'; private final String compositeEndpoint = '/composite/sobjects'; @SuppressWarnings('PMD.ApexSuggestUsingNamedCred') diff --git a/nebula-logger/main/logger-engine/classes/Logger.cls-meta.xml b/nebula-logger/main/logger-engine/classes/Logger.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/logger-engine/classes/Logger.cls-meta.xml +++ b/nebula-logger/main/logger-engine/classes/Logger.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/main/logger-engine/lwc/logger/__tests__/data/getLoggerSettings.json b/nebula-logger/main/logger-engine/lwc/logger/__tests__/data/getLoggerSettings.json index 4ed435303..6eb6a47b3 100644 --- a/nebula-logger/main/logger-engine/lwc/logger/__tests__/data/getLoggerSettings.json +++ b/nebula-logger/main/logger-engine/lwc/logger/__tests__/data/getLoggerSettings.json @@ -1,4 +1,5 @@ { + "defaultSaveMethod": "EVENT_BUS", "isEnabled": true, "isConsoleLoggingEnabled": true, "supportedLoggingLevels": { "FINEST": 2, "FINER": 3, "FINE": 4, "DEBUG": 5, "INFO": 6, "WARN": 7, "ERROR": 8 }, diff --git a/nebula-logger/main/logger-engine/lwc/logger/__tests__/logger.test.js b/nebula-logger/main/logger-engine/lwc/logger/__tests__/logger.test.js index 1886b004a..a8c6a967e 100644 --- a/nebula-logger/main/logger-engine/lwc/logger/__tests__/logger.test.js +++ b/nebula-logger/main/logger-engine/lwc/logger/__tests__/logger.test.js @@ -3,14 +3,14 @@ import Logger from 'c/logger'; import getSettings from '@salesforce/apex/ComponentLogger.getSettings'; import { registerApexTestWireAdapter } from '@salesforce/sfdx-lwc-jest'; -const mockGetSettings = require('./data/getLoggerSettings.json'); +const MOCK_GET_SETTINGS = require('./data/getLoggerSettings.json'); const getSettingsAdapter = registerApexTestWireAdapter(getSettings); jest.mock( '@salesforce/apex/ComponentLogger.getSettings', () => { return { - default: () => mockGetSettings + default: () => MOCK_GET_SETTINGS }; }, { virtual: true } @@ -22,12 +22,49 @@ describe('Logger lwc tests', () => { document.body.removeChild(document.body.firstChild); } jest.clearAllMocks(); + // jest.restoreAllMocks(); + }); + it('returns user settings', async () => { + const logger = createElement('c-logger', { is: Logger }); + document.body.appendChild(logger); + + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + + // await Promise.resolve(); + const userSettings = logger.getUserSettings(); + expect(userSettings.defaultSaveMethod).toEqual('EVENT_BUS'); + expect(userSettings.isEnabled).toEqual(true); + expect(userSettings.isConsoleLoggingEnabled).toEqual(true); + }); + it('sets a log scenario on all entries', async () => { + const logger = createElement('c-logger', { is: Logger }); + document.body.appendChild(logger); + + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = true; + + return Promise.resolve().then(() => { + const scenario = 'some scenario'; + const message = 'some message'; + const firstLogEntry = logger.finest(message); + expect(firstLogEntry.scenario).toBeUndefined(); + expect(logger.getBufferSize()).toEqual(1); + + const secondLogEntry = logger.info(message); + expect(secondLogEntry.scenario).toBeUndefined(); + expect(logger.getBufferSize()).toEqual(2); + + logger.setScenario(scenario); + + expect(firstLogEntry.scenario).toEqual(scenario); + expect(secondLogEntry.scenario).toEqual(scenario); + }); }); it('logs an ERROR entry', async () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel ERROR'; @@ -42,7 +79,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel WARN'; @@ -58,7 +95,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel INFO'; @@ -73,7 +110,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel DEBUG'; @@ -88,7 +125,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel FINE'; @@ -103,7 +140,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel FINER'; @@ -118,7 +155,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const message = 'component log entry with loggingLevel FINEST'; @@ -129,51 +166,11 @@ describe('Logger lwc tests', () => { expect(logEntry.message).toEqual(message); }); }); - it('sets a log scenario on all entries', async () => { - const logger = createElement('c-logger', { is: Logger }); - document.body.appendChild(logger); - - getSettingsAdapter.emit(mockGetSettings); - - return Promise.resolve().then(() => { - const scenario = 'some scenario'; - const message = 'some message'; - const firstLogEntry = logger.finest(message); - expect(firstLogEntry.scenario).toBeUndefined(); - expect(logger.getBufferSize()).toEqual(1); - - const secondLogEntry = logger.info(message); - expect(secondLogEntry.scenario).toBeUndefined(); - expect(logger.getBufferSize()).toEqual(2); - - logger.setScenario(scenario); - - expect(firstLogEntry.scenario).toEqual(scenario); - expect(secondLogEntry.scenario).toEqual(scenario); - }); - }); - it('flushes buffer', async () => { - const logger = createElement('c-logger', { is: Logger }); - document.body.appendChild(logger); - - getSettingsAdapter.emit(mockGetSettings); - - return Promise.resolve().then(() => { - const numberOfLogEntries = 3; - for (let i = 0; i < numberOfLogEntries; i++) { - logger.info('entry number: ' + i); - } - - expect(logger.getBufferSize()).toEqual(numberOfLogEntries); - logger.flushBuffer(); - expect(logger.getBufferSize()).toEqual(0); - }); - }); it('sets recordId', async () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const logEntry = logger.info('example log entry'); @@ -188,7 +185,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const logEntry = logger.info('example log entry'); @@ -204,7 +201,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const logEntry = logger.info('example log entry'); @@ -225,7 +222,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const logEntry = logger.info('example log entry'); @@ -240,7 +237,7 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); return Promise.resolve().then(() => { const logEntry = logger.info('example log entry'); @@ -255,30 +252,12 @@ describe('Logger lwc tests', () => { expect(logEntry.tags.length).toEqual(1); }); }); - it('saves log entries and flushes buffer', async () => { - const logger = createElement('c-logger', { is: Logger }); - document.body.appendChild(logger); - - getSettingsAdapter.emit(mockGetSettings); - - return Promise.resolve() - .then(() => { - logger.info('example INFO log entry'); - logger.debug('example DEBUG log entry'); - expect(logger.getBufferSize()).toBe(2); - - logger.saveLog(); - }) - .then(() => { - expect(logger.getBufferSize()).toBe(0); - }); - }); it('still works for ERROR when disabled', async () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -304,8 +283,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -332,8 +311,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -360,8 +339,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -388,8 +367,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -416,8 +395,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -444,8 +423,8 @@ describe('Logger lwc tests', () => { const logger = createElement('c-logger', { is: Logger }); document.body.appendChild(logger); - mockGetSettings.isEnabled = false; - getSettingsAdapter.emit(mockGetSettings); + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + logger.getUserSettings().isEnabled = false; return Promise.resolve().then(() => { const logEntry = logger @@ -468,4 +447,39 @@ describe('Logger lwc tests', () => { expect(logEntry.tags).toEqual(undefined); }); }); + it('flushes buffer', async () => { + const logger = createElement('c-logger', { is: Logger }); + document.body.appendChild(logger); + + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + + return Promise.resolve().then(() => { + const numberOfLogEntries = 3; + for (let i = 0; i < numberOfLogEntries; i++) { + logger.info('entry number: ' + i); + } + + expect(logger.getBufferSize()).toEqual(numberOfLogEntries); + logger.flushBuffer(); + expect(logger.getBufferSize()).toEqual(0); + }); + }); + it('saves log entries and flushes buffer', async () => { + const logger = createElement('c-logger', { is: Logger }); + document.body.appendChild(logger); + + getSettingsAdapter.emit({ ...MOCK_GET_SETTINGS }); + + return Promise.resolve() + .then(() => { + logger.info('example INFO log entry'); + logger.debug('example DEBUG log entry'); + expect(logger.getBufferSize()).toBe(2); + + logger.saveLog(); + }) + .then(() => { + expect(logger.getBufferSize()).toBe(0); + }); + }); }); diff --git a/nebula-logger/main/logger-engine/lwc/logger/logger.js b/nebula-logger/main/logger-engine/lwc/logger/logger.js index 05f9b651c..c7f3064ea 100644 --- a/nebula-logger/main/logger-engine/lwc/logger/logger.js +++ b/nebula-logger/main/logger-engine/lwc/logger/logger.js @@ -24,6 +24,19 @@ export default class Logger extends LightningElement { } } + @api + getUserSettings() { + return this.settings; + } + + @api + setScenario(scenario) { + this._scenario = scenario; + this.componentLogEntries.forEach(logEntry => { + logEntry.scenario = this._scenario; + }); + } + @api error(message) { return this._newEntry('ERROR', message); @@ -59,14 +72,6 @@ export default class Logger extends LightningElement { return this._newEntry('FINEST', message); } - @api - setScenario(scenario) { - this._scenario = scenario; - this.componentLogEntries.forEach(logEntry => { - logEntry.scenario = this._scenario; - }); - } - @api getBufferSize() { return this.componentLogEntries.length; @@ -78,9 +83,13 @@ export default class Logger extends LightningElement { } @api - saveLog() { + saveLog(saveMethodName) { if (this.getBufferSize() > 0) { - saveComponentLogEntries({ componentLogEntries: this.componentLogEntries }) + if (!saveMethodName && this.settings && this.settings.defaultSaveMethodName) { + saveMethodName = this.settings.defaultSaveMethodName; + } + + saveComponentLogEntries({ componentLogEntries: this.componentLogEntries, saveMethodName: saveMethodName }) .then(this.flushBuffer()) .catch(error => { if (this.settings.isConsoleLoggingEnabled === true) { diff --git a/nebula-logger/main/logger-engine/lwc/logger/logger.js-meta.xml b/nebula-logger/main/logger-engine/lwc/logger/logger.js-meta.xml index fe23df019..cbcb7f707 100644 --- a/nebula-logger/main/logger-engine/lwc/logger/logger.js-meta.xml +++ b/nebula-logger/main/logger-engine/lwc/logger/logger.js-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 false diff --git a/nebula-logger/main/plugin-framework/classes/LoggerSObjectHandlerPlugin.cls-meta.xml b/nebula-logger/main/plugin-framework/classes/LoggerSObjectHandlerPlugin.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/main/plugin-framework/classes/LoggerSObjectHandlerPlugin.cls-meta.xml +++ b/nebula-logger/main/plugin-framework/classes/LoggerSObjectHandlerPlugin.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/common/classes/LoggerTestUtils.cls-meta.xml b/nebula-logger/tests/common/classes/LoggerTestUtils.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/common/classes/LoggerTestUtils.cls-meta.xml +++ b/nebula-logger/tests/common/classes/LoggerTestUtils.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/configuration/classes/LoggerEmailUtils_Tests.cls-meta.xml b/nebula-logger/tests/configuration/classes/LoggerEmailUtils_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/configuration/classes/LoggerEmailUtils_Tests.cls-meta.xml +++ b/nebula-logger/tests/configuration/classes/LoggerEmailUtils_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/configuration/classes/LoggerParameter_Tests.cls-meta.xml b/nebula-logger/tests/configuration/classes/LoggerParameter_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/configuration/classes/LoggerParameter_Tests.cls-meta.xml +++ b/nebula-logger/tests/configuration/classes/LoggerParameter_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogBatchPurgeScheduler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogBatchPurgeScheduler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogBatchPurgeScheduler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogBatchPurgeScheduler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogBatchPurger_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogBatchPurger_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogBatchPurger_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogBatchPurger_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogEntryEventHandler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogEntryEventHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogEntryEventHandler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogEntryEventHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogEntryFieldSetPicklist_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogEntryHandler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogEntryHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogEntryHandler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogEntryHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogEntryTagHandler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogEntryTagHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogEntryTagHandler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogEntryTagHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogHandler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogHandler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LogMassDeleteExtension_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LogMassDeleteExtension_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LogMassDeleteExtension_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LogMassDeleteExtension_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/LoggerTagHandler_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/LoggerTagHandler_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/LoggerTagHandler_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/LoggerTagHandler_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/log-management/classes/RelatedLogEntriesController_Tests.cls-meta.xml b/nebula-logger/tests/log-management/classes/RelatedLogEntriesController_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/log-management/classes/RelatedLogEntriesController_Tests.cls-meta.xml +++ b/nebula-logger/tests/log-management/classes/RelatedLogEntriesController_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls b/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls index f58c8237a..223d7aba5 100644 --- a/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls @@ -44,7 +44,7 @@ private class ComponentLogger_Tests { static void it_should_return_aura_exception_when_it_breaks() { Test.startTest(); try { - ComponentLogger.saveComponentLogEntries(null); + ComponentLogger.saveComponentLogEntries(null, null); System.assert(false, 'This assert shouldn\'t run since this is a negative test'); } catch (Exception apexException) { System.assertEquals(AuraHandledException.class.getName(), apexException.getTypeName()); @@ -70,7 +70,48 @@ private class ComponentLogger_Tests { componentLogEntries.add(componentLogEntry); Test.startTest(); - ComponentLogger.saveComponentLogEntries(componentLogEntries); + ComponentLogger.saveComponentLogEntries(componentLogEntries, null); + Test.stopTest(); + + List logEntries = [ + SELECT Id, LoggingLevel__c, Message__c, RecordId__c, RecordJson__c, RecordSObjectType__c, Timestamp__c + FROM LogEntry__c + ]; + System.assertEquals(1, logEntries.size()); + + LogEntry__c logEntry = logEntries.get(0); + + System.assertEquals(componentLogEntry.loggingLevel, logEntry.LoggingLevel__c); + System.assertEquals(componentLogEntry.message, logEntry.Message__c); + System.assertEquals(componentLogEntry.recordId, logEntry.RecordId__c); + System.assertEquals(JSON.serializePretty(currentUser), logEntry.RecordJson__c); + System.assertEquals(Schema.SObjectType.User.getName(), logEntry.RecordSObjectType__c); + System.assertEquals(componentLogEntry.timestamp, logEntry.Timestamp__c); + } + + @IsTest + static void it_should_save_component_log_entry_with_queueable_job() { + upsert LoggerSettings__c.getInstance(); + System.assertEquals(0, [SELECT COUNT() FROM Log__c]); + + User currentUser = new User(FirstName = UserInfo.getFirstName(), Id = UserInfo.getUserId(), ProfileId = UserInfo.getProfileId()); + + List componentLogEntries = new List(); + ComponentLogger.ComponentLogEntry componentLogEntry = new ComponentLogger.ComponentLogEntry(); + componentLogEntry.loggingLevel = LoggingLevel.INFO.name(); + componentLogEntry.message = 'hello, world'; + componentLogEntry.recordId = currentUser.Id; + componentLogEntry.record = currentUser; + componentLogEntry.timestamp = System.now().addDays(-1 / 24); + componentLogEntry.tags = new List{ 'some tag', 'one more tag' }; + componentLogEntries.add(componentLogEntry); + + Test.startTest(); + System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); + + ComponentLogger.saveComponentLogEntries(componentLogEntries, Logger.SaveMethod.QUEUEABLE.name()); + + System.assertEquals(1, Limits.getQueueableJobs(), 'Log entries should have been saved using the QUEUEABLE save method'); Test.stopTest(); List logEntries = [ @@ -113,7 +154,7 @@ private class ComponentLogger_Tests { componentLogEntries.add(componentLogEntry); Test.startTest(); - ComponentLogger.saveComponentLogEntries(componentLogEntries); + ComponentLogger.saveComponentLogEntries(componentLogEntries, null); Test.stopTest(); List logEntries = [ @@ -146,7 +187,7 @@ private class ComponentLogger_Tests { componentLogEntries.add(componentLogEntry); Test.startTest(); - ComponentLogger.saveComponentLogEntries(componentLogEntries); + ComponentLogger.saveComponentLogEntries(componentLogEntries, null); Test.stopTest(); Log__c log = [SELECT Id, Scenario__c FROM Log__c]; @@ -168,7 +209,7 @@ private class ComponentLogger_Tests { componentLogEntries.add(componentLogEntry); Test.startTest(); - ComponentLogger.saveComponentLogEntries(componentLogEntries); + ComponentLogger.saveComponentLogEntries(componentLogEntries, null); Test.stopTest(); List logEntries = [ @@ -213,7 +254,7 @@ private class ComponentLogger_Tests { componentLogEntries.add(componentLogEntry); Test.startTest(); - ComponentLogger.saveComponentLogEntries(componentLogEntries); + ComponentLogger.saveComponentLogEntries(componentLogEntries, null); Test.stopTest(); List logEntries = [ diff --git a/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/ComponentLogger_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls b/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls index 836e7c9e6..4ad69cc66 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls @@ -102,6 +102,51 @@ private class FlowCollectionLogEntry_Tests { System.assertEquals(expectedUserJson, logEntry.RecordJson__c); } + @IsTest + static void it_should_auto_save_entry_with_save_method_when_saveMethodName_specified() { + User currentUser = new User( + Id = UserInfo.getUserId(), + FirstName = UserInfo.getFirstName(), + LastName = UserInfo.getLastName(), + Username = UserInfo.getUserName() + ); + + LoggingLevel userLoggingLevel = LoggingLevel.FINEST; + LoggingLevel flowCollectionEntryLoggingLevel = LoggingLevel.DEBUG; + System.assert(userLoggingLevel.ordinal() < flowCollectionEntryLoggingLevel.ordinal()); + + Test.startTest(); + System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); + + Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); + + FlowCollectionLogEntry flowCollectionEntry = createFlowCollectionLogEntry(); + flowCollectionEntry.loggingLevelName = flowCollectionEntryLoggingLevel.name(); + flowCollectionEntry.records = new List{ currentUser }; + flowCollectionEntry.saveLog = true; + flowCollectionEntry.saveMethodName = Logger.SaveMethod.QUEUEABLE.name(); + FlowCollectionLogEntry.addFlowCollectionEntries(new List{ flowCollectionEntry }); + + System.assertEquals(1, Limits.getQueueableJobs(), 'Log entries should have been saved using the QUEUEABLE save method'); + Test.stopTest(); + + String expectedUserJson = JSON.serializePretty(new List{ currentUser }); + + LogEntry__c logEntry = [ + SELECT Id, LoggingLevel__c, Message__c, OriginType__c, OriginLocation__c, RecordId__c, RecordCollectionType__c, RecordJson__c, RecordSObjectType__c + FROM LogEntry__c + ORDER BY CreatedDate + LIMIT 1 + ]; + System.assertEquals(flowCollectionEntry.loggingLevelName, logEntry.LoggingLevel__c); + System.assertEquals(flowCollectionEntry.message, logEntry.Message__c); + System.assertEquals('Flow', logEntry.OriginType__c); + System.assertEquals(null, logEntry.RecordId__c); + System.assertEquals('List', logEntry.RecordCollectionType__c); + System.assertEquals('User', logEntry.RecordSObjectType__c); + System.assertEquals(expectedUserJson, logEntry.RecordJson__c); + } + @IsTest static void it_should_not_save_entry_when_logging_level_not_met() { User currentUser = new User( diff --git a/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/FlowCollectionLogEntry_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls b/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls index 6abe92f69..8c6141725 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls @@ -69,6 +69,37 @@ private class FlowLogEntry_Tests { System.assertEquals('Flow', logEntry.OriginType__c); } + @IsTest + static void it_should_auto_save_entry_with_save_method_when_saveMethodName_specified() { + LoggingLevel userLoggingLevel = LoggingLevel.FINEST; + LoggingLevel flowEntryLoggingLevel = LoggingLevel.DEBUG; + System.assert(userLoggingLevel.ordinal() < flowEntryLoggingLevel.ordinal()); + + Test.startTest(); + System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); + + Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); + + FlowLogEntry flowEntry = createFlowLogEntry(); + flowEntry.loggingLevelName = flowEntryLoggingLevel.name(); + flowEntry.saveLog = true; + flowEntry.saveMethodName = Logger.SaveMethod.QUEUEABLE.name(); + FlowLogEntry.addFlowEntries(new List{ flowEntry }); + + System.assertEquals(1, Limits.getQueueableJobs(), 'Log entries should have been saved using the QUEUEABLE save method'); + Test.stopTest(); + + LogEntry__c logEntry = [ + SELECT Id, LoggingLevel__c, Message__c, OriginType__c, OriginLocation__c, RecordId__c, RecordJson__c + FROM LogEntry__c + ORDER BY CreatedDate + LIMIT 1 + ]; + System.assertEquals(flowEntry.loggingLevelName, logEntry.LoggingLevel__c); + System.assertEquals(flowEntry.message, logEntry.Message__c); + System.assertEquals('Flow', logEntry.OriginType__c); + } + @IsTest static void it_should_not_save_entry_when_logging_level_not_met() { LoggingLevel userLoggingLevel = LoggingLevel.ERROR; diff --git a/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/FlowLogEntry_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls b/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls index b3530967e..673fc8147 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls @@ -59,4 +59,33 @@ private class FlowLogger_Tests { System.assertEquals(1, [SELECT COUNT() FROM LogEntry__c]); } + + @IsTest + static void it_should_auto_save_entry_with_save_method_when_saveMethodName_specified() { + LoggingLevel entryLoggingLevel = LoggingLevel.DEBUG; + + Test.startTest(); + System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); + + Logger.getUserSettings().LoggingLevel__c = entryLoggingLevel.name(); + + FlowLogger.LogEntry logEntry = new FlowLogger.LogEntry(); + logEntry.flowName = 'MyFlow'; + logEntry.message = 'hello from Flow'; + logEntry.loggingLevelName = entryLoggingLevel.name(); + logEntry.saveLog = true; + logEntry.saveMethodName = Logger.SaveMethod.QUEUEABLE.name(); + logEntry.timestamp = System.now(); + + System.assertEquals(0, Logger.getBufferSize()); + System.assertEquals(0, [SELECT COUNT() FROM LogEntry__c]); + + FlowLogger.addEntries(new List{ logEntry }); + System.assertEquals(0, Logger.getBufferSize()); + + System.assertEquals(1, Limits.getQueueableJobs(), 'Log entries should have been saved using the QUEUEABLE save method'); + Test.stopTest(); + + System.assertEquals(1, [SELECT COUNT() FROM LogEntry__c]); + } } diff --git a/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/FlowLogger_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls b/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls index 3a6cf0241..1005b2b6e 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls @@ -58,6 +58,49 @@ private class FlowRecordLogEntry_Tests { System.assertEquals(expectedUserJson, logEntry.RecordJson__c); } + @IsTest + static void it_should_auto_save_entry_with_save_method_when_saveMethodName_specified() { + User currentUser = new User( + Id = UserInfo.getUserId(), + FirstName = UserInfo.getFirstName(), + LastName = UserInfo.getLastName(), + Username = UserInfo.getUserName() + ); + + LoggingLevel userLoggingLevel = LoggingLevel.FINEST; + LoggingLevel flowRecordEntryLoggingLevel = LoggingLevel.DEBUG; + System.assert(userLoggingLevel.ordinal() < flowRecordEntryLoggingLevel.ordinal()); + + Test.startTest(); + System.assertEquals(0, Limits.getQueueableJobs(), 'Test should start with 0 queueable jobs used'); + + Logger.getUserSettings().LoggingLevel__c = userLoggingLevel.name(); + + FlowRecordLogEntry flowRecordEntry = createFlowRecordLogEntry(); + flowRecordEntry.loggingLevelName = flowRecordEntryLoggingLevel.name(); + flowRecordEntry.record = currentUser; + flowRecordEntry.saveLog = true; + flowRecordEntry.saveMethodName = Logger.SaveMethod.QUEUEABLE.name(); + FlowRecordLogEntry.addFlowRecordEntries(new List{ flowRecordEntry }); + + System.assertEquals(1, Limits.getQueueableJobs(), 'Log entries should have been saved using the QUEUEABLE save method'); + Test.stopTest(); + + String expectedUserJson = JSON.serializePretty(currentUser); + + LogEntry__c logEntry = [ + SELECT Id, LoggingLevel__c, Message__c, OriginType__c, OriginLocation__c, RecordId__c, RecordJson__c + FROM LogEntry__c + ORDER BY CreatedDate + LIMIT 1 + ]; + System.assertEquals(flowRecordEntry.loggingLevelName, logEntry.LoggingLevel__c); + System.assertEquals(flowRecordEntry.message, logEntry.Message__c); + System.assertEquals('Flow', logEntry.OriginType__c); + System.assertEquals(currentUser.Id, logEntry.RecordId__c); + System.assertEquals(expectedUserJson, logEntry.RecordJson__c); + } + @IsTest static void it_should_auto_save_entry_when_saveLog_is_true() { User currentUser = new User( diff --git a/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/FlowRecordLogEntry_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/LogEntryEventBuilder_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/LogMessage_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/LogMessage_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/LogMessage_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/LogMessage_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls b/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls index 42635608e..46bbabd15 100644 --- a/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls +++ b/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls @@ -716,7 +716,7 @@ private class Logger_Tests { } @IsTest - static void it_should_save_via_event_bus_when_specified() { + static void it_should_save_via_event_bus_when_specified_via_settings() { Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -741,6 +741,35 @@ private class Logger_Tests { System.assertEquals(2, countOfLogEntries); } + @IsTest + static void it_should_save_via_event_bus_when_specified_via_setSaveMethod() { + Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(0, countOfLogEntries); + + setUserLoggingLevel(LoggingLevel.DEBUG); + + Logger.debug('test log entry'); + Logger.debug('another test log entry'); + + System.assertEquals(0, Limits.getPublishImmediateDml()); + + Test.startTest(); + + Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.EVENT_BUS; + Logger.setSaveMethod(expectedSaveMethod); + System.assertEquals(expectedSaveMethod, Logger.getSaveMethod()); + Logger.saveLog(); + System.assertEquals(1, Limits.getPublishImmediateDml()); + System.assertEquals(0, Limits.getQueueableJobs()); + System.assertEquals(0, Limits.getCallouts()); + System.assertEquals(0, Limits.getDmlStatements()); + + Test.stopTest(); + + countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(2, countOfLogEntries); + } + @IsTest static void it_should_save_via_queueable_when_defaulted() { Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; @@ -774,7 +803,7 @@ private class Logger_Tests { } @IsTest - static void it_should_save_via_queueable_when_specified() { + static void it_should_save_via_queueable_when_specified_via_settings() { Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -801,6 +830,37 @@ private class Logger_Tests { System.assertEquals(2, countOfLogEntries); } + @IsTest + static void it_should_save_via_queueable_when_specified_via_setSaveMethod() { + Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(0, countOfLogEntries); + + setUserLoggingLevel(LoggingLevel.DEBUG); + + Logger.debug('test log entry'); + Logger.debug('another test log entry'); + + System.assertEquals(0, Limits.getQueueableJobs()); + + Test.startTest(); + + Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.QUEUEABLE; + Logger.setSaveMethod(expectedSaveMethod); + System.assertEquals(expectedSaveMethod, Logger.getSaveMethod()); + Logger.saveLog(); + System.assertEquals(0, Limits.getPublishImmediateDml()); + System.assertEquals(1, Limits.getQueueableJobs()); + System.assertEquals(0, Limits.getCallouts()); + System.assertEquals(0, Limits.getDmlStatements()); + + Test.getEventBus().deliver(); + + Test.stopTest(); + + countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(2, countOfLogEntries); + } + @IsTest static void it_should_save_via_rest_api_when_defaulted() { Test.setMock(HttpCalloutMock.class, new SuccessCalloutMock()); @@ -831,7 +891,7 @@ private class Logger_Tests { } @IsTest - static void it_should_save_via_rest_api_when_specified() { + static void it_should_save_via_rest_api_when_specified_via_settings() { Test.setMock(HttpCalloutMock.class, new SuccessCalloutMock()); Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; @@ -855,6 +915,34 @@ private class Logger_Tests { Test.stopTest(); } + @IsTest + static void it_should_save_via_rest_api_when_specified_via_setSaveMethod() { + Test.setMock(HttpCalloutMock.class, new SuccessCalloutMock()); + + Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(0, countOfLogEntries); + + setUserLoggingLevel(LoggingLevel.DEBUG); + + Logger.debug('test log entry'); + Logger.debug('another test log entry'); + + System.assertEquals(0, Limits.getCallouts()); + + Test.startTest(); + + Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.REST; + Logger.setSaveMethod(expectedSaveMethod); + System.assertEquals(expectedSaveMethod, Logger.getSaveMethod()); + Logger.saveLog(); + System.assertEquals(0, Limits.getPublishImmediateDml()); + System.assertEquals(0, Limits.getQueueableJobs()); + System.assertEquals(1, Limits.getCallouts()); + System.assertEquals(0, Limits.getDmlStatements()); + + Test.stopTest(); + } + @IsTest static void it_should_throw_exception_when_save_via_rest_api_fails() { Test.setMock(HttpCalloutMock.class, new FailureCalloutMock()); @@ -916,7 +1004,7 @@ private class Logger_Tests { } @IsTest - static void it_should_save_via_synchronous_dml_when_specified() { + static void it_should_save_via_synchronous_dml_when_specified_via_settings() { Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; System.assertEquals(0, countOfLogEntries); @@ -942,6 +1030,36 @@ private class Logger_Tests { Test.stopTest(); } + @IsTest + static void it_should_save_via_synchronous_dml_when_specified_via_setSaveMethod() { + Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(0, countOfLogEntries); + + setUserLoggingLevel(LoggingLevel.DEBUG); + + Logger.debug('test log entry'); + Logger.debug('another test log entry'); + + System.assertEquals(0, Limits.getCallouts()); + + Test.startTest(); + + Logger.SaveMethod expectedSaveMethod = Logger.SaveMethod.SYNCHRONOUS_DML; + Logger.setSaveMethod(expectedSaveMethod); + System.assertEquals(expectedSaveMethod, Logger.getSaveMethod()); + Logger.saveLog(); + System.assertEquals(0, Limits.getPublishImmediateDml()); + System.assertEquals(0, Limits.getQueueableJobs()); + System.assertEquals(0, Limits.getCallouts()); + System.assertNotEquals(0, Limits.getDmlStatements()); + + // Requery & assert before Test.stopTest() since this is supposed to save synchronously + countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; + System.assertEquals(2, countOfLogEntries); + + Test.stopTest(); + } + @IsTest static void it_should_not_set_user_fields_when_anonymous_mode_enabled() { Integer countOfLogEntries = [SELECT COUNT() FROM LogEntry__c]; diff --git a/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls-meta.xml b/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls-meta.xml +++ b/nebula-logger/tests/logger-engine/classes/Logger_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/nebula-logger/tests/plugin-framework/classes/LoggerSObjectHandlerPlugin_Tests.cls-meta.xml b/nebula-logger/tests/plugin-framework/classes/LoggerSObjectHandlerPlugin_Tests.cls-meta.xml index f8e5ab635..871a8cfea 100644 --- a/nebula-logger/tests/plugin-framework/classes/LoggerSObjectHandlerPlugin_Tests.cls-meta.xml +++ b/nebula-logger/tests/plugin-framework/classes/LoggerSObjectHandlerPlugin_Tests.cls-meta.xml @@ -1,5 +1,5 @@ - 52.0 + 53.0 Active diff --git a/package.json b/package.json index cce23ea05..8e969a242 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nebula-logger", - "version": "4.6.12", + "version": "4.6.13", "description": "Designed for Salesforce admins, developers & architects. A robust logger for Apex, Flow, Process Builder & Integrations.", "author": "Jonathan Gillespie", "license": "MIT", @@ -32,7 +32,7 @@ "devhub:details": "pwsh ./scripts/build/get-devhub-org-details.ps1", "devhub:limits": "pwsh ./scripts/build/get-devhub-org-limits.ps1", "devhub:open": "pwsh ./scripts/build/open-devhub-org.ps1", - "docs:fix": "pwsh ./scripts/build/generate-docs.ps1", + "docs:fix": "pwsh ./scripts/build/generate-docs.ps1 && git add ./docs && git commit --amend --no-edit", "docs:verify": "pwsh ./scripts/build/verify-docs-up-to-date.ps1", "experience:create": "sfdx force:community:create --name \"Logger Test Site\" --templatename \"Customer Service\" --urlpathprefix logger --description \"Logger Test Site\"", "husky:pre-commit": "lint-staged", @@ -61,7 +61,7 @@ "test": "npm run test:lwc && npm run test:apex", "test:apex": "sfdx force:apex:test:run --verbose --testlevel RunLocalTests --wait 30 --resultformat human --codecoverage --detailedcoverage --outputdir ./tests/apex", "test:apex:suites": "sfdx force:apex:test:run --verbose --suitenames LoggerConfiguration,LoggerEngine,LoggerLogManagement,LoggerPluginFramework --wait 30 --resultformat human --codecoverage --detailedcoverage --outputdir ./tests/apex", - "test:lwc": "sfdx-lwc-jest --coverage" + "test:lwc": "sfdx-lwc-jest --coverage --skipApiVersionCheck" }, "dependencies": { "set-value": ">=4.0.1", diff --git a/scripts/build/generate-docs.ps1 b/scripts/build/generate-docs.ps1 index d88fad690..463ea2c93 100644 --- a/scripts/build/generate-docs.ps1 +++ b/scripts/build/generate-docs.ps1 @@ -30,4 +30,4 @@ mv ./docs/Configuration/ ./docs/configuration/ mv ./docs/Logger-Engine/ ./docs/logger-engine/ mv ./docs/Log-Management/ ./docs/log-management/ mv ./docs/Plugin-Framework/ ./docs/plugin-framework/ -prettier ./docs/ --write +prettier ./docs/ --write \ No newline at end of file diff --git a/sfdx-project.json b/sfdx-project.json index c570aa635..bba8e2c5c 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -1,16 +1,16 @@ { "namespace": "", "sfdcLoginUrl": "https://login.salesforce.com", - "sourceApiVersion": "52.0", + "sourceApiVersion": "53.0", "packageDirectories": [ { "package": "Nebula Logger - Unlocked Package", "path": "nebula-logger", "default": false, "definitionFile": "config/project-scratch-def-with-experience-cloud.json", - "versionNumber": "4.6.12.0", - "versionName": "Log Scenario Rules", - "versionDescription": "Added new CMDT LogScenarioRule__mdt to configure scenario-specific logging levels and retention dates", + "versionNumber": "4.6.13.0", + "versionName": "Save Method Support for Flows and Lightning Components", + "versionDescription": "Adds the ability to specify a save method in the Flow log entry invocable classes", "releaseNotesUrl": "https://github.com/jongpie/NebulaLogger/releases" }, { @@ -60,6 +60,7 @@ "Nebula Logger - Unlocked Package@4.6.10-0-new-log-and-logger-settings-fields": "04t5Y0000015l27QAA", "Nebula Logger - Unlocked Package@4.6.11-0-admin-enhancements---new-dashboard,-reports,-and-error-email-alerts": "04t5Y0000015l2qQAA", "Nebula Logger - Unlocked Package@4.6.12-0-log-scenario-rules": "04t5Y0000015l3oQAA", + "Nebula Logger - Unlocked Package@4.6.13-0-save-method-support-for-flows-and-lightning-components": "04t5Y0000015l4cQAA", "Nebula Logger - Unlocked Package@4.6.2-0-anonymous-logs": "04t5Y0000015kgPQAQ", "Nebula Logger - Unlocked Package@4.6.3-0-more-metadata-data": "04t5Y0000015kgeQAA", "Nebula Logger - Unlocked Package@4.6.4-0-logger-for-lwc-and-aura": "04t5Y0000015kgjQAA",