Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
jongpie committed Oct 22, 2024
1 parent 6b0fe5f commit 154db70
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 73 deletions.
2 changes: 1 addition & 1 deletion docs/apex/Configuration/LoggerCache.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: default

## LoggerCache class

Class used to cache query results returned by the selector classes
Class used to cache query results & data used in other parts of Nebula Logger

---

Expand Down
139 changes: 139 additions & 0 deletions docs/apex/Configuration/LoggerConfigurationSelector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
layout: default
---

## LoggerConfigurationSelector class

Selector class used for all queries that are specific to the configuration layer.

---

### Methods

#### `getInstance()``LoggerConfigurationSelector`

The instance of `LoggerConfigurationSelector` used for any querying specific to the configuration layer

##### Return

**Type**

LoggerConfigurationSelector

**Description**

The singleton instance of `LoggerConfigurationSelector`

#### `getLogEntryDataMaskRules()``List<LogEntryDataMaskRule_t>`

Returns the `LogEntryDataMaskRule_t` records in the org.

##### Return

**Type**

List&lt;LogEntryDataMaskRule_t&gt;

**Description**

`List&lt;LogEntryDataMaskRule_t&gt;` containing records in the org

#### `getLogEntryTagRules()``List<LogEntryTagRule_t>`

Returns the enabled `LogEntryTagRule_t` records in the org, including the field `SObjectField__r.QualifiedApiName` that cannot be accessed via `LogEntryTagRule_t.getAll()`. The value of `SObjectField__c` is automatically set to the value of `SObjectField__r.QualifiedApiName`

##### Return

**Type**

List&lt;LogEntryTagRule_t&gt;

**Description**

`List&lt;LogEntryTagRule_t&gt;` containing enabled records in the org

#### `getLogStatuses()``List<LogStatus_t>`

Returns the `LogStatus_t` records in the org.

##### Return

**Type**

List&lt;LogStatus_t&gt;

**Description**

`List&lt;LogStatus_t&gt;` containing records in the org

#### `getLoggerFieldMappings()``List<LoggerFieldMapping_t>`

Returns the enabled `LoggerFieldMapping_t` records in the org.

##### Return

**Type**

List&lt;LoggerFieldMapping_t&gt;

**Description**

`List&lt;LoggerFieldMapping_t&gt;` containing enabled records in the org

#### `getLoggerParameters()``Map<String, LoggerParameter_t>`

Returns the `LoggerParameter_t` records in the org.

##### Return

**Type**

Map&lt;String, LoggerParameter_t&gt;

**Description**

`List&lt;LoggerParameter_t&gt;` containing records in the org

#### `getLoggerPlugins()``List<LoggerPlugin_t>`

Returns the `LoggerPlugin_t` records in the org.

##### Return

**Type**

List&lt;LoggerPlugin_t&gt;

**Description**

`List&lt;LoggerPlugin_t&gt;` containing records in the org

#### `getLoggerSObjectHandlers()``List<LoggerSObjectHandler_t>`

Returns the `LoggerSObjectHandler_t` records in the org.

##### Return

**Type**

List&lt;LoggerSObjectHandler_t&gt;

**Description**

`List&lt;LoggerSObjectHandler_t&gt;` containing records in the org

#### `getLoggerScenarioRules()``List<LoggerScenarioRule_t>`

Returns the `LoggerScenarioRule_t` records in the org.

##### Return

**Type**

List&lt;LoggerScenarioRule_t&gt;

**Description**

`List&lt;LoggerScenarioRule_t&gt;` containing records in the org

---
2 changes: 1 addition & 1 deletion docs/apex/Log-Management/LogManagementDataSelector.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ List&lt;Schema.FlowVersionView&gt;

**Description**

`List&lt;Schema.FlowDefinitionView&gt;` containing any matching records
`List&lt;Schema.FlowVersionView&gt;` containing any matching records

#### `getInstance()``LogManagementDataSelector`

Expand Down
30 changes: 6 additions & 24 deletions docs/apex/Logger-Engine/LoggerSObjectProxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Proxy class used as a middle layer between some problematic SObject Types and th

---

### Inner Classes
### Methods

#### LoggerSObjectProxy.AuthSession class

All `Schema.AuthSession` SObjects are read-only in Apex, which makes them more difficult to work with, and impossible to mock field values directly during unit tests - even using tricks like System.JSON.deserialize() do not work. The `LoggerSObjectProxy.AuthSession` class acts as a substitute for a `Schema.AuthSession` record to provide the abilility to mock the data during unit &amp; integration tests.
#### `serialize()``String`

---

##### Constructors
### Inner Classes

#### LoggerSObjectProxy.AuthSession class

###### `AuthSession(Schema.AuthSession authSessionRecord)`
All `Schema.AuthSession` SObjects are read-only in Apex, which makes them more difficult to work with, and impossible to mock field values directly during unit tests - even using tricks like System.JSON.deserialize() do not work. The `LoggerSObjectProxy.AuthSession` class acts as a substitute for a `Schema.AuthSession` record to provide the abilility to mock the data during unit &amp; integration tests.

---

Expand Down Expand Up @@ -52,12 +52,6 @@ All `Schema.LoginHistory` SObjects are read-only in Apex, which makes them more

---

##### Constructors

###### `LoginHistory(Schema.LoginHistory loginHistoryRecord)`

---

##### Properties

###### `Application``String`
Expand All @@ -76,12 +70,6 @@ Not all orgs have the SObject `Schema.Network` - it is only present in orgs that

---

##### Constructors

###### `Network(SObject networkRecord)`

---

##### Properties

###### `Id``String`
Expand All @@ -98,12 +86,6 @@ Not all orgs have the SObject `Schema.OmniProcess` - it is only present in orgs

---

##### Constructors

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

---

##### Properties

###### `CreatedBy``Schema.User`
Expand Down
6 changes: 5 additions & 1 deletion docs/apex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ Class used by the logging system for batch contextual details

### [LoggerCache](Configuration/LoggerCache)

Class used to cache query results returned by the selector classes
Class used to cache query results &amp; data used in other parts of Nebula Logger

### [LoggerConfigurationSelector](Configuration/LoggerConfigurationSelector)

Selector class used for all queries that are specific to the configuration layer.

### [LoggerFieldMapper](Configuration/LoggerFieldMapper)

Expand Down
15 changes: 15 additions & 0 deletions docs/lightning-components/Logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<dt><a href="#getUserSettings">getUserSettings()</a> <code>ComponentLogger.ComponentLoggerSettings</code></dt>
<dd><p>Returns <strong>read-only</strong> information about the current user&#39;s settings, stored in <code>LoggerSettings__c</code></p>
</dd>
<dt><a href="#setField">setField(fieldToValue)</a></dt>
<dd><p>Sets multiple field values on the builder&#39;s <code>LogEntryEvent__e</code> record</p>
</dd>
<dt><a href="#setScenario">setScenario(scenario)</a></dt>
<dd><p>Sets the scenario name for the current transaction - this is stored in <code>LogEntryEvent__e.Scenario__c</code>
and <code>Log__c.Scenario__c</code>, and can be used to filter &amp; group logs</p>
Expand Down Expand Up @@ -66,6 +69,18 @@ Returns **read-only** information about the current user's settings, stored in `

**Kind**: global function
**Returns**: <code>ComponentLogger.ComponentLoggerSettings</code> - The current user's instance of the Apex class `ComponentLogger.ComponentLoggerSettings`
<a name="setField"></a>

## setField(fieldToValue)

Sets multiple field values on the builder's `LogEntryEvent__e` record

**Kind**: global function

| Param | Type | Description |
| ------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fieldToValue | <code>Object</code> | An object containing the custom field name as a key, with the corresponding value to store. Example: `{"SomeField__c": "some value", "AnotherField__c": "another value"}` |

<a name="setScenario"></a>

## setScenario(scenario)
Expand Down
Loading

0 comments on commit 154db70

Please sign in to comment.