Add HttpRequest/HttpResponse support to CallableLogger's newEntry action - #1024
Open
simonfcodes wants to merge 1 commit into
Open
Add HttpRequest/HttpResponse support to CallableLogger's newEntry action#1024simonfcodes wants to merge 1 commit into
simonfcodes wants to merge 1 commit into
Conversation
CallableLogger's newEntry action only recognized exception, recordId/ record/recordList/recordMap, tags, parentLogTransactionId, and saveLog as input keys - there was no way to pass an HttpRequest/HttpResponse through the Callable bridge, even though LogEntryEventBuilder already exposes setHttpRequestDetails()/setHttpResponseDetails() for the direct fluent API. Adds two new optional input keys, following the same containsKey-guarded pattern already used for exception/record: - httpRequest (System.HttpRequest), optionally paired with httpRequestHeadersToLog (List<String>) to match the existing setHttpRequestDetails() overload - httpResponse (System.HttpResponse) No schema changes needed - the target fields already exist on LogEntryEvent__e/LogEntry__c. Fixes jongpie#1023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1023.
What
CallableLogger'snewEntryaction only recognizedexception,recordId/record/recordList/recordMap,tags,parentLogTransactionId, andsaveLogas input keys. There was no way to pass anHttpRequest/HttpResponsethrough theCallablebridge, even thoughLogEntryEventBuilderalready exposessetHttpRequestDetails()/setHttpResponseDetails()for the direct fluent API (added per #240). That meant packages using theCallableinterface for loose coupling (per the Dynamically Call Nebula Logger wiki) couldn't get HTTP-aware log entries at all.Change
Two new optional input keys on the
newEntryaction, following the samecontainsKey-guarded pattern already used forexception/record/tags:httpRequest(System.HttpRequest), optionally paired withhttpRequestHeadersToLog(List<String>) to match the existingsetHttpRequestDetails()overloadhttpResponse(System.HttpResponse)No schema changes - the target
HttpRequest*__c/HttpResponse*__cfields already exist onLogEntryEvent__e/LogEntry__c, they just weren't reachable through this bridge.Testing
Added 2 new tests to
CallableLogger_Tests.cls(HttpRequest with headers-to-log, and HttpResponse), following the existing test conventions in that file. Ranprettierand the repo's PMD rule set (pmd:(1,2,3)) against both changed files locally - clean on both.This is a starting proposal on the exact input-key shape - happy to adjust the design if a different approach (e.g. a DTO) is preferred.