Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
jongpie committed Sep 14, 2024
1 parent 7aa8f70 commit 396014e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/apex/Configuration/LoggerParameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ Controls if Nebula Logger queries `Schema.Network` data. When set to `false`, an

Controls if Nebula Logger queries `Schema.Network` data is queried synchronously & populated on `LogEntryEvent__e` records. When set to `false`, any `Schema.Network` fields on `LogEntryEvent__e` will not be populated - the data will instead be queried asynchronously and populated on any resulting `Log__c` records. Controlled by the custom metadata record `LoggerParameter.QueryNetworkDataSynchronously`, or `true` as the default

#### `QUERY_OMNI_PROCESS_DATA``Boolean`

Controls if Nebula Logger queries `Schema.OmniProcess` data. When set to `false`, any `Schema.OmniProcess` fields on `LogEntry__c` will not be populated Controlled by the custom metadata record `LoggerParameter.QueryOmniProcessData`, or `true` as the default

#### `QUERY_ORGANIZATION_DATA``Boolean`

Controls if Nebula Logger queries `Schema.Organization` data. When set to `false`, any `Schema.Organization` fields on `LogEntryEvent__e` and `Log__c` will not be populated Controlled by the custom metadata record `LoggerParameter.QueryOrganizationData`, or `true` as the default
Expand Down
4 changes: 3 additions & 1 deletion docs/apex/Logger-Engine/CallableLogger.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default

## CallableLogger class

A class that implements the standard interface `System.Callable` to provide a loosely-coupled way to interact with Nebula Logger. This can be used for OmniStudio, as well as for optionally & dynamically integrating other packages/code with Nebula Logger's code (when available).
A class that implements the standard interface `System.Callable`. This provides 2 benefits: 1. A loosely-coupled way to optionally integrate with Nebula Logger (useful for ISVs/package developers). 2. The ability to log in OmniStudio's OmniScripts & Integration Procedures.

### Related

Expand Down Expand Up @@ -37,4 +37,6 @@ Object

The value returned by the `Logger` method called as an `Object` instance, or `null` if the method being called does not have a return value

#### `handleCall(String action, Map<String, Object> input, Map<String, Object> output)``void`

---
22 changes: 22 additions & 0 deletions docs/apex/Logger-Engine/LoggerSObjectProxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,25 @@ Not all orgs have the SObject `Schema.Network` - it is only present in orgs that
###### `UrlPathPrefix``String`

---

#### LoggerSObjectProxy.OmniProcess class

Not all orgs have the SObject `Schema.OmniProcess` - it is only present in orgs that have enabled OmniStudio, so `Schema.OmniProcess` has to be referenced dynamically, including using hardcoded `String` values for field API names. The `LoggerSObjectProxy.OmniProcess` class acts as a substitute for a `Schema.OmniProcess` record so that the rest of the codebase can rely on strongly-typed references to fields (properties).

---

##### Constructors

###### `OmniProcess(SObject omniProcess)`

---

##### Properties

###### `Id``String`

###### `IsIntegrationProcedure``Boolean`

###### `UniqueName``String`

---
2 changes: 1 addition & 1 deletion docs/apex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: default

### [CallableLogger](Logger-Engine/CallableLogger)

A class that implements the standard interface `System.Callable` to provide a loosely-coupled way to interact with Nebula Logger. This can be used for OmniStudio, as well as for optionally &amp; dynamically integrating other packages/code with Nebula Logger&apos;s code (when available).
A class that implements the standard interface `System.Callable`. This provides 2 benefits: 1. A loosely-coupled way to optionally integrate with Nebula Logger (useful for ISVs/package developers). 2. The ability to log in OmniStudio&apos;s OmniScripts &amp; Integration Procedures.

### [ComponentLogger](Logger-Engine/ComponentLogger)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ global without sharing class CallableLogger implements System.Callable {
}
}

@SuppressWarnings('PMD.NcssMethodCount')
@SuppressWarnings('PMD.CognitiveComplexity, PMD.NcssMethodCount')
private LogEntryEventBuilder newEntry(Map<String, Object> input) {
// The value of loggingLevel could be either a string name or an enum value from System.LoggingLevel,
// so always first convert it to a string for consistency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// See LICENSE file or go to https://github.com/jongpie/NebulaLogger for full license details. //
//------------------------------------------------------------------------------------------------//

@SuppressWarnings('PMD.ApexDoc, PMD.ApexAssertionsShouldIncludeMessage, PMD.MethodNamingConventions')
@SuppressWarnings('PMD.ApexDoc, PMD.ApexAssertionsShouldIncludeMessage, PMD.AvoidHardcodingId, PMD.MethodNamingConventions')
@IsTest(IsParallel=true)
private class CallableLogger_Tests {
// Not all orgs have OmniStudio, so not all orgs will have the OmniProcess SObject
// Not all orgs have OmniStudio, so not all orgs will have the OmniProcess SObject.
// Instead of trying to create an actual ID, this test ID can be used. It was the ID
// of an actual record in a scratch org with OmniStudio enabled.
private static final String TEST_OMNI_PROCESS_ID = '0jNDL000000Cbac2AC';
Expand Down

0 comments on commit 396014e

Please sign in to comment.