Skip to content

Adding Overloads to Logger.logDatabaseErrors() methods with List<SObjects> - #985

Merged
jongpie merged 8 commits into
jongpie:mainfrom
DivyanshuBist:feature/AddingOverloadstologDatabaseErrors
Aug 4, 2026
Merged

Adding Overloads to Logger.logDatabaseErrors() methods with List<SObjects>#985
jongpie merged 8 commits into
jongpie:mainfrom
DivyanshuBist:feature/AddingOverloadstologDatabaseErrors

Conversation

@DivyanshuBist

Copy link
Copy Markdown
Contributor

PR for #942 ,
added overloads for Logger.logDatabaseErrors with parameter List

@DivyanshuBist
DivyanshuBist requested a review from jongpie as a code owner May 9, 2026 16:32
@jongpie

jongpie commented May 14, 2026

Copy link
Copy Markdown
Owner

Thanks for making this PR @DivyanshuBist! I am planning to review & merge this in the next few days.

@jongpie jongpie added Logging Source: Apex Items related to using Logger within Apex Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Type: Enhancement New feature or request Salesforce Feature: Reporting Anything related to reports, dashboards, and the underlying data model labels May 14, 2026
github-actions Bot pushed a commit to nebulity/NebulaLogger that referenced this pull request Jun 14, 2026
jongpie added 7 commits August 3, 2026 16:18
…mplementation to preserve the SObjectType of the list parameter, suppressed PMD violations for ExcessiveParameterList on the new overloads, tweaked ApexDocs comments, generated updated Apex docs files, and ran prettier to format new overloads
…ignore the List<SObject> records when the size doesn't match the list of database results

Previously, the implementation was returning an error entry indicating that the sizes doesn't match - that causes data loss because the original message, logging level, and database results weren't being logged at all
…loads and LogEntryEventBuilder.setDatabaseResult() overloads to treat a list with 1 record as a list, instead of as a single instance

This makes it consistent with the behavior of setRecord() overloads

@jongpie jongpie left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DivyanshuBist - thanks for working on this PR! I spent the last day or two reviewing & have pushed several changes to the PR, including:

  • Adding tests
  • Changing the behavior when the list of database results & the list of SObject recoreds don't match. Now it just simply ignores the list of SObject records when there's a mismatch.
  • Scope creep: there was some existing behavior in LogEntryEventBuilder that I didn't like, so I've tweaked the behavior in this PR

I'm planning to merge & release this later today 🥳

@jongpie jongpie linked an issue Aug 4, 2026 that may be closed by this pull request
@jongpie
jongpie merged commit 22d0101 into jongpie:main Aug 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex Salesforce Feature: Reporting Anything related to reports, dashboards, and the underlying data model Type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add overloads to Logger.logDatabaseErrors() to accept List<SObject>

2 participants