Skip to content

Commit

Permalink
Add support for logging instances of Database.EmptyRecycleBinResult a…
Browse files Browse the repository at this point in the history
…nd List<Database.EmptyRecycleBinResult> (#806)

* Add new instance method overloads in LogEntryEventBuilder for setDatabaseResult() to support logging Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>

* Added new static method overloads in Logger to make it easier to log instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>

* Simplified + improved readability of some older Apex code throughout the codebase by using the safe navigator operator ?. and null coalescing operator ?? in several places

* Fixed some existing code that caused PMD scan violations in newer versions of PMD/sf code analyzer

---------

Co-authored-by: Marek Madejski <[email protected]>
Co-authored-by: Jonathan Gillespie <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2024
1 parent 9484c4b commit b5ac18e
Show file tree
Hide file tree
Showing 24 changed files with 6,223 additions and 1,679 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

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

## Unlocked Package - v4.15.1
## Unlocked Package - v4.15.2

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

`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015ohhQAA`
`sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oifQAA`

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class MicrobatchSelfRegController {
public String communityNickname {
get;
set {
communityNickname = value == null ? value : value.trim();
communityNickname = value?.trim();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ public with sharing class SiteRegisterController {
public String password {
get;
set {
password = value == null ? value : value.trim();
password = value?.trim();
}
}
public String confirmPassword {
get;
set {
confirmPassword = value == null ? value : value.trim();
confirmPassword = value?.trim();
}
}
public String communityNickname {
get;
set {
communityNickname = value == null ? value : value.trim();
communityNickname = value?.trim();
}
}

Expand Down
64 changes: 52 additions & 12 deletions docs/apex/Logger-Engine/LogEntryEventBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ LogEntryEventBuilder

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.LeadConvertResult leadConvertResult)``LogEntryEventBuilder`
#### `setDatabaseResult(Database.DeleteResult deleteResult)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields

##### Parameters

| Param | Description |
| ------------------- | --------------------------------------------------- |
| `leadConvertResult` | The instance of `Database.LeadConvertResult` to log |
| Param | Description |
| -------------- | ---------------------------------------------- |
| `deleteResult` | The instance of `Database.DeleteResult` to log |

##### Return

Expand All @@ -160,15 +160,15 @@ LogEntryEventBuilder

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)``LogEntryEventBuilder`
#### `setDatabaseResult(Database.EmptyRecycleBinResult emptyRecycleBinResult)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields

##### Parameters

| Param | Description |
| -------------------- | ------------------------------------------------ |
| `leadConvertResults` | The list of `Database.LeadConvertResult`s to log |
| Param | Description |
|-------------------------|---------------------------------------------------------|
| `emptyRecycleBinResult` | The instance of `Database.EmptyRecycleBinResult` to log |

##### Return

Expand All @@ -180,15 +180,15 @@ LogEntryEventBuilder

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.DeleteResult deleteResult)``LogEntryEventBuilder`
#### `setDatabaseResult(Database.LeadConvertResult leadConvertResult)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields

##### Parameters

| Param | Description |
| -------------- | ---------------------------------------------- |
| `deleteResult` | The instance of `Database.DeleteResult` to log |
| Param | Description |
| ------------------- | --------------------------------------------------- |
| `leadConvertResult` | The instance of `Database.LeadConvertResult` to log |

##### Return

Expand Down Expand Up @@ -300,6 +300,46 @@ LogEntryEventBuilder

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.EmptyRecycleBinResult> emptyRecycleBinResults)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields

##### Parameters

| Param | Description |
|--------------------------|------------------------------------------------------|
| `emptyRecycleBinResults` | The list of `Database.EmptyRecycleBinResult`s to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields

##### Parameters

| Param | Description |
| -------------------- | ------------------------------------------------ |
| `leadConvertResults` | The list of `Database.LeadConvertResult`s to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.MergeResult> mergeResults)``LogEntryEventBuilder`

Sets the log entry event&apos;s database operation result fields
Expand Down
Loading

0 comments on commit b5ac18e

Please sign in to comment.