Skip to content

New 'Logger Settings' lwc/tab

Compare
Choose a tag to compare
@jongpie jongpie released this 16 Dec 21:49
· 117 commits to main since this release
166dd93

⚠️ For orgs that are upgrading to this version: you may need to review & update your org's configurations - 3 fields on the custom hierarchy settings object LoggerSettings__c have been renamed in this release:

  • AnonymousMode__cIsAnonymousModeEnabled__c
  • ApplyDataMaskRules__cIsDataMaskingEnabled__c
  • IsComponentConsoleLoggingEnabled__cIsJavaScriptConsoleLoggingEnabled__c

New 'Logger Settings' lwc/tab

PR #254 introduces a new lwc, loggerSettings, as a tab in the Logger Console app. It provides several features for managing LoggerSettings__c records:

  • Provides a datatable of all LoggerSettings__c records, along with functionality to view, create, edit and delete records. Anyone with access to the tab/lwc can see the datatable and the 'View' row action - but in order to access/use the 'New' button (create), and the 'Edit' & 'Delete' row actions, users must either have update access on the LoggerSettings__c object(LoggerSettings__c.SObjectType.getDescribe().isUpdateable()), or have the custom permission 'Can Modify Logger Settings' (FeatureManagement.checkPermission('CanModifyLoggerSettings')). This is useful for orgs where people may have the LoggerAdmin permission set, but aren't full System Admins.

    • The LoggerAdmin permission set has access to view, create, edit, and delete
    • The LoggerLogViewer permission set only has access to view
    • The LoggerLogCreator and LoggerEndUser permission sets do not have access to the tab/lwc

    image

  • Provides picklist-style inputs for fields that really should be picklists. Custom settings objects do not support several field types, including picklists - instead, text fields are used on the object, but this can lead to bad config data being entered (e.g., an admin/developer mistypes the name of a LoggingLevel or Logger.SaveMethod enum value. The lwc solves this by presenting these fields as picklists, using some Apex in the LoggerSettingsController class to generate the list of picklist options. This prevants any isssues with tpyos, and it simplifies the configuration process for admins/developers

    image

  • Bonus unexpected feature: using this component, you can now configure LoggerSettings__c for the the Automated Process user. When using the standard UI for custom settings, you cannot search for/select the Automated Process user, but it apparently works just fine when the settings record is created via Apex

    image

Other LWC Changes

  • Added icon on logEntryEventStream, fixed some issues with unresolved Promises in jest tests
  • Improved jest tests for logViewer component

Documentation Enhancements

  • Added JSDoc comments the 2 classes in the lwc logger.js: Logger and LogEntryBuilder. JSDoc comments have also been incorporated into the GitHub Pages site will now include these docs going forward (alongside the existing Apex docs)
  • Cleaned up some ApexDoc comments in various classes for better clarity

Pipeline Enhancements

  • Made the pipeline faster by adding caching in the pipeline for sfdx-cli
  • Automated org type testing by updating the pipeline to deploy to 2 different scratch orgs (in parallel) to confirm the metadata works in 2 contexts:
    • A base scratch org - an Enterprise Edition org with Chatter enabled, and Experience Cloud disabled
    • An Experience Cloud scratch org - this is the same as the base org, but also has Experience Cloud enabled, with 1 site created
  • pipeline uses 2 scratch orgs now to cover different scenarios

Thanks so much to @jamessimone for a ton of help on this release! 🥳