Skip to content

Commit

Permalink
Added new method Logger.logDatabaseErrors() (plus overloads) (#318)
Browse files Browse the repository at this point in the history
* Resolves #295 - Added new method Logger.logDatabaseErrors(), including several overloads for using LogMessage/String, as well as the different database result classes (Database.DeleteResult, Database.MergeResult, Database.SaveResult, Database.UpsertResult, Database.UndeleteResult)

* Bumped package version number, name & description

* Updated ApexDocs
  • Loading branch information
jongpie authored May 26, 2022
1 parent c866d36 commit 7b8a591
Show file tree
Hide file tree
Showing 8 changed files with 1,011 additions and 9 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.7.3
## Unlocked Package - v4.7.4

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

## Managed Package - v4.7.0
Expand Down
220 changes: 220 additions & 0 deletions docs/apex/Logger-Engine/Logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -4084,6 +4084,226 @@ Boolean

Boolean

#### `logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List<Database.DeleteResult> deleteResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;DeleteResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| --------------- | ------------------------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |
| `deleteResults` | The instance of `List&lt;Database.DeleteResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, String message, List<Database.DeleteResult> deleteResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;DeleteResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| --------------- | ---------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `message` | The string to use to set the entry&apos;s message field |
| `deleteResults` | The instance of `List&lt;Database.DeleteResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List<Database.MergeResult> mergeResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;MergeResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| -------------- | ------------------------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |
| `mergeResults` | The instance of `List&lt;Database.MergeResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, String message, List<Database.MergeResult> mergeResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;MergeResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| -------------- | --------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `message` | The string to use to set the entry&apos;s message field |
| `mergeResults` | The instance of `List&lt;Database.MergeResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List<Database.SaveResult> saveResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;SaveResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| -------------- | ------------------------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |
| `saveResults` | The instance of `List&lt;Database.SaveResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, String message, List<Database.SaveResult> saveResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;SaveResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| -------------- | -------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `message` | The string to use to set the entry&apos;s message field |
| `saveResults` | The instance of `List&lt;Database.SaveResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List<Database.UpsertResult> upsertResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;UpsertResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| --------------- | ------------------------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |
| `upsertResults` | The instance of `List&lt;Database.UpsertResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, String message, List<Database.UpsertResult> upsertResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;UpsertResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| --------------- | ---------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `message` | The string to use to set the entry&apos;s message field |
| `upsertResults` | The instance of `List&lt;Database.UpsertResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, LogMessage logMessage, List<Database.UndeleteResult> undeleteResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;UndeleteResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| ----------------- | ------------------------------------------------------------------------- |
| `loggingLevel` | The logging level to use for the log entry |
| `logMessage` | The instance of `LogMessage` to use to set the entry&apos;s message field |
| `undeleteResults` | The instance of `List&lt;Database.UndeleteResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `logDatabaseErrors(LoggingLevel loggingLevel, String message, List<Database.UndeleteResult> undeleteResults)``LogEntryEventBuilder`

Creates a log entry for any results within the provided `List&lt;UndeleteResult&gt;` where `isSuccess() != true`

##### Parameters

| Param | Description |
| ----------------- | ------------------------------------------------------------ |
| `loggingLevel` | The logging level to use for the log entry |
| `message` | The string to use to set the entry&apos;s message field |
| `undeleteResults` | The instance of `List&lt;Database.UndeleteResult&gt;` to log |

##### Return

**Type**

LogEntryEventBuilder

**Description**

The instance of `LogEntryBuilder` was generated to log any errors, or `null` if there are no errors

#### `meetsUserLoggingLevel(LoggingLevel logEntryLoggingLevel)``Boolean`

Indicates if the specified logging level is enabled for the current user, based on the custom setting LoggerSettings\_\_c
Expand Down
2 changes: 2 additions & 0 deletions docs/apex/Logger-Engine/LoggerCache.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The singleton instance of `TransactionCache`

#### LoggerCache.TransactionCache class

Manages any transaction-specific caching

---

##### Methods
Expand Down
Loading

0 comments on commit 7b8a591

Please sign in to comment.