Skip to content

Updated Logger.getUserSettings() to set defaults based on the environment type

Compare
Choose a tag to compare
@jongpie jongpie released this 30 Nov 14:29
· 83 commits to main since this release
d91e665

Core Unlocked Package Changes

  • Updated LoggerSettings__c fields LoggingLevel__c, IsApexSystemDebugLoggingEnabled__c, and IsJavaScriptConsoleLoggingEnabled__c to make the default values be the recommended values for production orgs
  • Closed #364 by updating Logger.getUserSettings() to set some field values based on if the current org is a sandbox. This also applies when using the included 'Logger Settings' tab (which displays the LWC loggerSettings).
    • In production, the default field values are now:
      • LoggingLevel__c now defaults to 'INFO'
      • IsApexSystemDebugLoggingEnabled__c and IsJavaScriptConsoleLoggingEnabled__c default to false
    • In sandboxes & scratch orgs, the default field values are now:
      • LoggingLevel__c now defaults to 'FINEST'
      • IsApexSystemDebugLoggingEnabled__c and IsJavaScriptConsoleLoggingEnabled__c default to true
  • Updated LoggerEngineDataSelector class to still leverage data cached in Platform Cache (if available), even if querying is disabled for a particular method
  • Added the System namespace to all references to the FeatureManagement class - this helps avoid naming collisions in orgs using the unlocked package that have a custom class with the same name
  • Removed some lingering references to Logger in LogEntryBuilder & LogEntryBuilder_Tests, which finishes up some ongoing tech debt cleanup to make LogEntryEventBuilder independent/unaware of Logger

Pipeline Improvements

  • Made test execution faster in the pipeline by updating build.yml to skip unnecessary code coverage calculations for all test runs except for the final synchronous run in the Experience Cloud scratch org (when code coverage data is uploaded to Codecov.io)