Skip to content

Commit

Permalink
Fixes #205 - Eliminated DML on LoggerSettings__c, improved in-memory …
Browse files Browse the repository at this point in the history
…creation of defaults
  • Loading branch information
jongpie committed Sep 16, 2021
1 parent 2173bc8 commit e6e4c51
Show file tree
Hide file tree
Showing 16 changed files with 4,858 additions and 2,972 deletions.
2 changes: 1 addition & 1 deletion docs/log-management/LogBatchPurger.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default

## LogBatchPurger class

Batch class used to delete old logs, based on `Log__c.LogRetentionDate__c <= :System.today()`
Batch class used to delete old logs, based on `Log__c.LogRetentionDate__c &lt;= :System.today()`

### Related

Expand Down
2 changes: 1 addition & 1 deletion docs/log-management/LogEntryHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default

## LogEntryHandler class

Manages setting fields on `LogEntry__c` before insert & before update
Manages setting fields on `LogEntry__c` before insert &amp; before update

---

Expand Down
2 changes: 1 addition & 1 deletion docs/log-management/LogHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default

## LogHandler class

Manages setting fields on `Log__c` before insert & before update
Manages setting fields on `Log__c` before insert &amp; before update

---

Expand Down
2 changes: 1 addition & 1 deletion docs/log-management/LogMassDeleteExtension.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Filters the list of selected `Log__c` records to only include records that the c

**Type**

List<Log\_\_c>
List&lt;Log\_\_c&gt;

**Description**

Expand Down
2 changes: 1 addition & 1 deletion docs/log-management/LoggerSObjectHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Abstract class used by trigger handlers for shared logic

#### `execute()``void`

Runs the handler class's logic
Runs the handler class&apos;s logic

#### `getSObjectType()``SObjectType`

Expand Down
10 changes: 5 additions & 5 deletions docs/logger-engine/ComponentLogger.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Controller class used by the lightning web component `logger`

#### `getSettings()``ComponentLoggerSettings`

Provides data to the frontend about `LoggerSettings__c` & server-supported logging details
Provides data to the frontend about `LoggerSettings__c` &amp; server-supported logging details

##### Return

Expand Down Expand Up @@ -64,11 +64,11 @@ A DTO object used to log details about a JavaScript error

###### `message``String`

The error's message
The error&apos;s message

###### `stack``String`

The error's stack trace
The error&apos;s stack trace

###### `type``String`

Expand All @@ -94,11 +94,11 @@ The name of the `LoggingLevel` enum value

###### `message``String`

The value to use as the log entry's message
The value to use as the log entry&apos;s message

###### `record``SObject`

(Optional) The record to relate to the log entry - the record's JSON is also stored
(Optional) The record to relate to the log entry - the record&apos;s JSON is also stored

###### `recordId``Id`

Expand Down
8 changes: 4 additions & 4 deletions docs/logger-engine/FlowCollectionLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ The name of the Flow creating the log entry. Due to Salesforce limitations, this

#### `loggingLevelName``String`

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

#### `message``String`

The message to log

#### `records``List<SObject>`

The records to relate to this log entry - the records' JSON is automatically added to the log entry
The records to relate to this log entry - the records&apos; JSON is automatically added to the log entry

#### `saveLog``Boolean`

Expand Down Expand Up @@ -74,10 +74,10 @@ addFlowRecordEntries description

**Type**

List<String>
List&lt;String&gt;

**Description**

The current transaction's ID (based on `Logger.getTransactionId()`)
The current transaction&apos;s ID (based on `Logger.getTransactionId()`)

---
6 changes: 3 additions & 3 deletions docs/logger-engine/FlowLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The name of the Flow creating the log entry. Due to Salesforce limitations, this

#### `loggingLevelName``String`

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

#### `message``String`

Expand Down Expand Up @@ -74,10 +74,10 @@ addFlowEntries description

**Type**

List<String>
List&lt;String&gt;

**Description**

The current transaction's ID (based on `Logger.getTransactionId()`)
The current transaction&apos;s ID (based on `Logger.getTransactionId()`)

---
8 changes: 4 additions & 4 deletions docs/logger-engine/FlowRecordLogEntry.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ The name of the Flow creating the log entry. Due to Salesforce limitations, this

#### `loggingLevelName``String`

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

#### `message``String`

The message to log

#### `record``SObject`

The record to relate to this log entry - the record's JSON is automatically added to the log entry
The record to relate to this log entry - the record&apos;s JSON is automatically added to the log entry

#### `saveLog``Boolean`

Expand Down Expand Up @@ -74,10 +74,10 @@ addFlowRecordEntries description

**Type**

List<String>
List&lt;String&gt;

**Description**

The current transaction's ID (based on `Logger.getTransactionId()`)
The current transaction&apos;s ID (based on `Logger.getTransactionId()`)

---
56 changes: 28 additions & 28 deletions docs/logger-engine/LogEntryEventBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Used by `Logger` to instantiate a new instance of `LogEntryEventBuilder`

##### Parameters

| Param | Description |
| ------------------- | ------------------------------------------------------------------------------- |
| `entryLoggingLevel` | The `LoggingLevel` enum to use for the builder's instance of `LogEntryEvent__e` |
| `shouldSave` | Determines if the builder's instance of `LogEntryEvent__e` should be saved |
| Param | Description |
| ------------------- | ------------------------------------------------------------------------------------ |
| `entryLoggingLevel` | The `LoggingLevel` enum to use for the builder&apos;s instance of `LogEntryEvent__e` |
| `shouldSave` | Determines if the builder&apos;s instance of `LogEntryEvent__e` should be saved |

---

Expand Down Expand Up @@ -85,7 +85,7 @@ The `LogEntryEvent__e` record

#### `parseStackTrace(String stackTraceString)``LogEntryEventBuilder`

Parses the provided stack trace and sets the log entry's origin & stack trace fields
Parses the provided stack trace and sets the log entry&apos;s origin &amp; stack trace fields

##### Parameters

Expand All @@ -105,7 +105,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

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

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

##### Parameters

Expand All @@ -125,7 +125,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.MergeResult mergeResult)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -145,7 +145,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.SaveResult saveResult)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -165,7 +165,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.UpsertResult upsertResult)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -185,7 +185,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(Database.UndeleteResult undeleteResult)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -205,7 +205,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.DeleteResult> deleteResults)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -225,7 +225,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

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

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

##### Parameters

Expand All @@ -245,7 +245,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.SaveResult> saveResults)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -265,7 +265,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.UpsertResult> upsertResults)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -285,7 +285,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setDatabaseResult(List<Database.UndeleteResult> undeleteResults)``LogEntryEventBuilder`

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

##### Parameters

Expand All @@ -305,7 +305,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setExceptionDetails(Exception apexException)``LogEntryEventBuilder`

Sets the log entry event's exception fields
Sets the log entry event&apos;s exception fields

##### Parameters

Expand All @@ -325,13 +325,13 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setMessage(LogMessage logMessage)``LogEntryEventBuilder`

Sets the log entry event's message field
Sets the log entry event&apos;s message field

##### Parameters

| Param | Description |
| ------------ | -------------------------------------------------------------------- |
| `logMessage` | The instance of `LogMessage` to use to set the entry's message field |
| Param | Description |
| ------------ | ------------------------------------------------------------------------- |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |

##### Return

Expand All @@ -345,13 +345,13 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setMessage(String message)``LogEntryEventBuilder`

Sets the log entry event's message field
Sets the log entry event&apos;s message field

##### Parameters

| Param | Description |
| --------- | -------------------------------------------------- |
| `message` | The string to use to set the entry's message field |
| Param | Description |
| --------- | ------------------------------------------------------- |
| `message` | The string to use to set the entry&apos;s message field |

##### Return

Expand All @@ -365,7 +365,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setRecord(Id recordId)``LogEntryEventBuilder`

Sets the log entry event's record fields
Sets the log entry event&apos;s record fields

##### Parameters

Expand All @@ -385,7 +385,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setRecord(SObject record)``LogEntryEventBuilder`

Sets the log entry event's record fields
Sets the log entry event&apos;s record fields

##### Parameters

Expand All @@ -405,7 +405,7 @@ The same instance of `LogEntryEventBuilder`, useful for chaining methods

#### `setRecord(List<SObject> records)``LogEntryEventBuilder`

Sets the log entry event's record fields
Sets the log entry event&apos;s record fields

##### Parameters

Expand Down Expand Up @@ -433,7 +433,7 @@ Deprecated - use `setRecord(SObject record)` instead

#### `setTopics(List<String> tags)``LogEntryEventBuilder`

Deprecated - use `addTags(List<String> tags)` instead. This method will be removed in a future release
Deprecated - use `addTags(List&lt;String&gt; tags)` instead. This method will be removed in a future release

#### `shouldSave()``Boolean`

Expand Down
2 changes: 1 addition & 1 deletion docs/logger-engine/LogMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ String formattedMessage = new LogMessage(unformattedMessage, arguments).getMessa

#### `getMessage()``String`

Returns the formatted string to use as the log entry's message
Returns the formatted string to use as the log entry&apos;s message

##### Return

Expand Down
Loading

0 comments on commit e6e4c51

Please sign in to comment.