Skip to content

Commit

Permalink
SaveMethod support in Flow & Lightning Components, Regex filtering in…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
jongpie and jamessimone authored Nov 18, 2021
1 parent cc8f333 commit e9ac332
Show file tree
Hide file tree
Showing 120 changed files with 955 additions and 334 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions docs/logger-engine/ComponentLogger.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ ComponentLoggerSettings

return The instance of `ComponentLoggerSettings` for the current user

#### `saveComponentLogEntries(List<ComponentLogEntry> componentLogEntries)``String`
#### `saveComponentLogEntries(List<ComponentLogEntry> 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

Expand Down Expand Up @@ -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&apos;s `console.log()` is enabled for the current user, based on `Logger.IsComponentConsoleLoggingEnabled__c`
Expand Down
6 changes: 5 additions & 1 deletion docs/logger-engine/FlowCollectionLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -46,6 +46,10 @@ The records to relate to this log entry - the records&apos; JSON is automaticall

Optionally choose to save any pending log entries

#### `saveMethodName``String`

Optionally choose the save method to use when &apos;Save Log&apos; is true

#### `scenario``String`

Optionally specify the name to use for the current transaction&apos;s scenario
Expand Down
10 changes: 7 additions & 3 deletions docs/logger-engine/FlowLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,27 @@ 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`

Optionally specify a logging level - the default is &apos;DEBUG&apos;

#### `message``String`

The message to log.
The message to log

#### `recordId``Id`

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 &apos;Save Log&apos; is true

#### `scenario``String`

Expand Down
22 changes: 13 additions & 9 deletions docs/logger-engine/FlowLogger.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,43 +60,47 @@ 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&apos;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 &apos;Save Log&apos; == true

###### `scenario``String`

Optionally specify the name to use for the current transaction&apos;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`

timestamp of the log

###### `topics``List<String>`

List of tags / topics.
List of tags / topics

---

##### Methods

###### `addToLoggerBuffer()``LogEntryEventBuilder`

Adds the logger to the buffer.
Adds the logger to the buffer

####### Return

Expand All @@ -106,6 +110,6 @@ LogEntryEventBuilder

**Description**

An instance of LogEntryEventBuilder.
An instance of LogEntryEventBuilder

---
6 changes: 5 additions & 1 deletion docs/logger-engine/FlowRecordLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -46,6 +46,10 @@ The record to relate to this log entry - the record&apos;s JSON is automatically

Optionally choose to save any pending log entries

#### `saveMethodName``String`

Optionally choose the save method to use when &apos;Save Log&apos; is true

#### `scenario``String`

Optionally specify the name to use for the current transaction&apos;s scenario
Expand Down
14 changes: 14 additions & 0 deletions docs/logger-engine/Logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,20 @@ String

String - The parent log&apos;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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>A screen Flow used to help test the Apex class LogEntryHandler</description>
<interviewLabel>LogEntryHandler Screen Tests for Flow {!$Flow.CurrentDateTime}</interviewLabel>
<label>LogEntryHandler Screen Tests for Flow</label>
Expand Down
2 changes: 1 addition & 1 deletion extra-tests/flows/LogEntryHandler_Tests_Flow.flow-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>50.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>An auto-launched Flow used to help test the Apex class LogEntryHandler</description>
<interviewLabel>LogEntryHandler_Tests_Flow {!$Flow.CurrentDateTime}</interviewLabel>
<label>LogEntryHandler Tests for Flow</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>A scheduled Flow used in tests to verify that LogEntryHandler automatically logs details about the Flow (metadata data)</description>
<interviewLabel>LogEntryHandler_Tests_Scheduled_Flow {!$Flow.CurrentDateTime}</interviewLabel>
<label>LogEntryHandler_Tests_Scheduled_Flow</label>
Expand Down
2 changes: 1 addition & 1 deletion extra-tests/flows/LogHandler_Tests_Flow.flow-meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>49.0</apiVersion>
<apiVersion>53.0</apiVersion>
<assignments>
<name>Update_user_s_first_name</name>
<label>Update user&apos;s first name</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/tests/LogEntryHandler_Tests_Flow.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/tests/LogHandler_Tests_Flow.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/tests/Logger_Tests_ExperienceSite.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion extra-tests/tests/Logger_Tests_MergeResult.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion managed-package/sfdx-project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"namespace": "Nebula",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "52.0",
"sourceApiVersion": "53.0",
"packageDirectories": [
{
"package": "Nebula Logger - Managed Package",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<assignments>
<description>An example field update</description>
<name>Update_Account</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
</value>
</inputParameters>
</actionCalls>
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<decisions>
<processMetadataValues>
<name>index</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>52.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>A screen Flow used to help test the Apex class LogEntryHandler</description>
<interviewLabel>LogEntryHandler Screen Tests for Flow {!$Flow.CurrentDateTime}</interviewLabel>
<label>LogEntryHandler Screen Tests for Flow</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</inputParameters>
<storeOutputAutomatically>true</storeOutputAutomatically>
</actionCalls>
<apiVersion>50.0</apiVersion>
<apiVersion>53.0</apiVersion>
<description>An auto-launched Flow used to help test the Apex class LogEntryHandler</description>
<interviewLabel>LogEntryHandler_Tests_Flow {!$Flow.CurrentDateTime}</interviewLabel>
<label>LogEntryHandler Tests for Flow</label>
Expand Down
Loading

0 comments on commit e9ac332

Please sign in to comment.