Skip to content

Commit b5ac18e

Browse files
TrangOulMarek Madejskijongpie
authored
Add support for logging instances of Database.EmptyRecycleBinResult and 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]>
1 parent 9484c4b commit b5ac18e

File tree

24 files changed

+6223
-1679
lines changed

24 files changed

+6223
-1679
lines changed

README.md

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

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

8-
## Unlocked Package - v4.15.1
8+
## Unlocked Package - v4.15.2
99

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

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

1616
---
1717

config/scratch-orgs/experience-cloud/classes/MicrobatchSelfRegController.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class MicrobatchSelfRegController {
55
public String communityNickname {
66
get;
77
set {
8-
communityNickname = value == null ? value : value.trim();
8+
communityNickname = value?.trim();
99
}
1010
}
1111

config/scratch-orgs/experience-cloud/classes/SiteRegisterController.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public with sharing class SiteRegisterController {
1414
public String password {
1515
get;
1616
set {
17-
password = value == null ? value : value.trim();
17+
password = value?.trim();
1818
}
1919
}
2020
public String confirmPassword {
2121
get;
2222
set {
23-
confirmPassword = value == null ? value : value.trim();
23+
confirmPassword = value?.trim();
2424
}
2525
}
2626
public String communityNickname {
2727
get;
2828
set {
29-
communityNickname = value == null ? value : value.trim();
29+
communityNickname = value?.trim();
3030
}
3131
}
3232

docs/apex/Logger-Engine/LogEntryEventBuilder.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ LogEntryEventBuilder
140140

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

143-
#### `setDatabaseResult(Database.LeadConvertResult leadConvertResult)``LogEntryEventBuilder`
143+
#### `setDatabaseResult(Database.DeleteResult deleteResult)``LogEntryEventBuilder`
144144

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

147147
##### Parameters
148148

149-
| Param | Description |
150-
| ------------------- | --------------------------------------------------- |
151-
| `leadConvertResult` | The instance of `Database.LeadConvertResult` to log |
149+
| Param | Description |
150+
| -------------- | ---------------------------------------------- |
151+
| `deleteResult` | The instance of `Database.DeleteResult` to log |
152152

153153
##### Return
154154

@@ -160,15 +160,15 @@ LogEntryEventBuilder
160160

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

163-
#### `setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)``LogEntryEventBuilder`
163+
#### `setDatabaseResult(Database.EmptyRecycleBinResult emptyRecycleBinResult)``LogEntryEventBuilder`
164164

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

167167
##### Parameters
168168

169-
| Param | Description |
170-
| -------------------- | ------------------------------------------------ |
171-
| `leadConvertResults` | The list of `Database.LeadConvertResult`s to log |
169+
| Param | Description |
170+
|-------------------------|---------------------------------------------------------|
171+
| `emptyRecycleBinResult` | The instance of `Database.EmptyRecycleBinResult` to log |
172172

173173
##### Return
174174

@@ -180,15 +180,15 @@ LogEntryEventBuilder
180180

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

183-
#### `setDatabaseResult(Database.DeleteResult deleteResult)``LogEntryEventBuilder`
183+
#### `setDatabaseResult(Database.LeadConvertResult leadConvertResult)``LogEntryEventBuilder`
184184

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

187187
##### Parameters
188188

189-
| Param | Description |
190-
| -------------- | ---------------------------------------------- |
191-
| `deleteResult` | The instance of `Database.DeleteResult` to log |
189+
| Param | Description |
190+
| ------------------- | --------------------------------------------------- |
191+
| `leadConvertResult` | The instance of `Database.LeadConvertResult` to log |
192192

193193
##### Return
194194

@@ -300,6 +300,46 @@ LogEntryEventBuilder
300300

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

303+
#### `setDatabaseResult(List<Database.EmptyRecycleBinResult> emptyRecycleBinResults)``LogEntryEventBuilder`
304+
305+
Sets the log entry event&apos;s database operation result fields
306+
307+
##### Parameters
308+
309+
| Param | Description |
310+
|--------------------------|------------------------------------------------------|
311+
| `emptyRecycleBinResults` | The list of `Database.EmptyRecycleBinResult`s to log |
312+
313+
##### Return
314+
315+
**Type**
316+
317+
LogEntryEventBuilder
318+
319+
**Description**
320+
321+
The same instance of `LogEntryEventBuilder`, useful for chaining methods
322+
323+
#### `setDatabaseResult(List<Database.LeadConvertResult> leadConvertResults)``LogEntryEventBuilder`
324+
325+
Sets the log entry event&apos;s database operation result fields
326+
327+
##### Parameters
328+
329+
| Param | Description |
330+
| -------------------- | ------------------------------------------------ |
331+
| `leadConvertResults` | The list of `Database.LeadConvertResult`s to log |
332+
333+
##### Return
334+
335+
**Type**
336+
337+
LogEntryEventBuilder
338+
339+
**Description**
340+
341+
The same instance of `LogEntryEventBuilder`, useful for chaining methods
342+
303343
#### `setDatabaseResult(List<Database.MergeResult> mergeResults)``LogEntryEventBuilder`
304344

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

0 commit comments

Comments
 (0)