Skip to content

Commit

Permalink
Renamed LoggerSettings__c.DefaultLogScenario__c to LoggerSettings__c.…
Browse files Browse the repository at this point in the history
…DefaultScenario__c
  • Loading branch information
jongpie committed Sep 13, 2022
1 parent d1297bb commit 1a556d8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>DefaultLogScenario__c</fullName>
<fullName>DefaultScenario__c</fullName>
<businessStatus>Active</businessStatus>
<complianceGroup>CCPA;GDPR;PII</complianceGroup>
<description>Sets a default scenario for the transaction</description>
<externalId>false</externalId>
<inlineHelpText>Sets a default scenario for the transaction</inlineHelpText>
<label>Log Scenario</label>
<label>Scenario</label>
<length>255</length>
<required>false</required>
<securityClassification>Confidential</securityClassification>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
<fields>Origin__c</fields>
<fields>Message__c</fields>
<fields>RecordDetailedLink__c</fields>
<fields>EntryScenario__c</fields>
<fields>LoggingLevelWithImage__c</fields>
<fields>TransactionEntryNumber__c</fields>
<relatedList>LogEntry__c.Log__c</relatedList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@
"localApiName": "LoggingLevel__c",
"type": "String"
},
"DefaultLogScenario__c": {
"apiName": "DefaultLogScenario__c",
"DefaultScenario__c": {
"apiName": "DefaultScenario__c",
"inlineHelpText": "Sets a default scenario for the transaction",
"label": "Log Scenario",
"localApiName": "DefaultLogScenario__c",
"localApiName": "DefaultScenario__c",
"type": "String"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const PAGE_LAYOUT_CONFIG = {
showInEditMode: true,
columns: [
{ fieldApiNames: ['DefaultNumberOfDaysToRetainLogs__c', 'DefaultLogPurgeAction__c'], size: 6 },
{ fieldApiNames: ['DefaultLogScenario__c', 'DefaultLogShareAccessLevel__c', 'DefaultLogOwner__c'], size: 6 }
{ fieldApiNames: ['DefaultScenario__c', 'DefaultLogShareAccessLevel__c', 'DefaultLogOwner__c'], size: 6 }
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions nebula-logger/core/main/logger-engine/classes/Logger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ global with sharing class Logger {
private static final Quiddity TRANSACTION_QUIDDITY = setTransactionQuiddity();
private static final Boolean USE_FIRST_SPECIFIED_SCENARIO_AS_TRANSACTION_SCENARIO = LoggerParameter.getBoolean('UseFirstSpecifiedScenario', true);

private static String currentEntryScenario = getUserSettings().DefaultLogScenario__c;
private static String currentEntryScenario = getUserSettings().DefaultScenario__c;
private static Integer currentTransactionEntryNumber = 1;
@TestVisible
private static String lastSaveMethodNameUsed;
private static String parentLogTransactionId;
@TestVisible
private static Integer saveLogCallCount = 0;
private static Boolean suspendSaving = false;
private static String transactionScenario = getUserSettings().DefaultLogScenario__c;
private static String transactionScenario = getUserSettings().DefaultScenario__c;
private static LoggerSettings__c userSettings;

private static String transactionSaveMethodName {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ private class Logger_Tests {
static void it_should_set_scenario_when_default_scenario_configured() {
String mockScenario = 'some test scenario for this transaction';
LoggerSettings__c userSettings = LoggerSettings__c.getInstance();
userSettings.DefaultLogScenario__c = mockScenario;
userSettings.DefaultScenario__c = mockScenario;
upsert userSettings;

String currentScenario = Logger.getScenario();

System.assertEquals(
mockScenario,
currentScenario,
'The value of LoggerSettings__c.DefaultLogScenario__c should have been used as the current transaction scenario'
'The value of LoggerSettings__c.DefaultScenario__c should have been used as the current transaction scenario'
);
}

Expand Down

0 comments on commit 1a556d8

Please sign in to comment.