Skip to content

Releases: jongpie/NebulaLogger

Approval Results Logging

17 Apr 22:24
12926c7

Choose a tag to compare

Thanks goes to @PawelWozniak for suggesting this enhancement (issue #844), and to @TrangOul & @jamessimone for working on the changes!

Core Unlocked Package Changes

  • Added new setApprovalResult() methods in LogEntryEventBuilder for logging instances of the standard Apex classes Approval.LockResult, Approval.ProcessResult, Approval.UnlockResult, as well as lists of each class. Developers can use the new method overloads with something like this:

    SObject someRecord = [SELECT Id FROM Account LIMIT 1];
    Approval.LockResult lockResult = Approval.lock(someRecord);
    
    // The builder's new method overloads setApprovalResult() can be called to capture approval details
    Logger.debug('Locked record for approval', someRecord)
        .setApprovalResult(lockResult);
    Logger.saveLog();
  • The approval result data is stored in the existing set of DatabaseResult* fields on LogEntry__c like LogEntry__c.DatabaseResultType__c, shown below:

    image

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.15.9...v4.15.10

Bugfix: Entry Save Override Is Not Always Used

03 Apr 16:11
ec2cfe8

Choose a tag to compare

Thanks again to @jvega-intakedesk & team for reporting issue #856 (via discussion #855), helping to test PR #857! 🥳

Core Unlocked Package Changes

Quick context on this release: in Apex, developers have the ability to force certain entries to always save, even if the entry's logging level doesn't meet the current user's logging level (e.g., a DEBUG entry can be made to always save, even if the user's logging level is set to INFO). This is useful for a lot of teams in a lot of situations (such as auditing/monitoring requirements), and has been a feature for a loooong time.

But, @jvega-intakedesk & team recently pointed out that although the LogEntryEvent__e platform events are successfully published, the corresponding LogEntry__c records are inadvertently not created. This release corrects this issue with a few changes:

  • Added new fields EntrySaveReason__c on LogEntryEvent__e & LogEntry__c to explicitly track why an entry is saved, with 2 possible values:

    1. Logging Level Met: indicates that the entry was saved because the entry's specified logging level meets the logging user's configured logging level settings, stored in LoggerSettings__c.LoggingLevel__c.
    2. Save Overridden: indicates that the entry was saved because a developer has overridden in code the shouldSave flag for the entry. This is done by developers to ensure certain entries are always logged, regardless of the user's configured logging level.
  • Updated LogEntryEventBuilder and LogEntryEventHandler to set the new fields on LogEntryEvent__e and LogEntry__c.

    • ℹ️ Going forward, all new LogEntryEvent__e and LogEntry__c records will now have a value populated in EntrySaveReason__c.
    • ⚠️ Existing LogEntry__c records will still have null - no changes are being introduced to backfill the data.
  • Updated the logic in LogEntryEventHandler.filterLogEntryEventsToSave() to check the value of the new field LogEntryEvent__e.EntrySaveReason__c. Any entries with a save reason of Override are always saved in LogEntry__c (which is the piece that directly fixes #856).

  • The flexipage LogEntryRecordPage has also been updated to display the new field LogEntry__c.EntrySaveReason__c when it's populated. For any existing LogEntry__c records with a null value, the flexipage will hide the field.

    image

    image

Installation Info

Core Unlocked Package - no namespace

Custom Index for Log__c.ParentLogTransactionId__c

04 Mar 18:27
0a637d7

Choose a tag to compare

  • Fixes #847 by adding Log__c.ParentLogTransactionId__c custom index

This is a small release that will help unblock our friends at Google. See the prior release for more!

Fix Stacktrace Parsing & Reduce logger.test.js

18 Feb 19:46
58e7b4a

Choose a tag to compare

Thanks again to @jamessimone for working on yet another awesome release! 🥇 (See PR #835)

Core Unlocked Package Changes

  • Fixed an issue in LoggerStackTrace.js that would cause an unintended exception when there isn't a valid JavaScript stack trace.
    • This issue previously could happen when logging within the managed package, as well as in some browser configs that have more restrictive settings enabled.
  • Added @api decorator to the the function logger.setField() so that it can be used when logging in Aura components.
  • Closed #780 by cleaning up logger.test.js, resulting in, 1,400 lines of JavaScript code being removed! 🧹
    • Over the years, 3 different approaches have been used within Nebula Logger to provide JavaScript logging. The older approaches are considered deprecated, but are still supported - so automated testing is critical to ensuring all approaches still work.
    • Previously, logger.test.js had test cases duplicated for all 3 approaches, making it a nightmare to maintain.
    • In this release, @jamessimone streamlined the tests so that the same test cases are now used to validate all 3 approaches.

Installation Info

Core Unlocked Package - no namespace

OmniStudio Logging Enhancements

17 Feb 20:49
dc057c1

Choose a tag to compare

Thanks to @jamessimone for several OmniStudio improvements in this release! 🎉 (See PR #835)

Core Unlocked Package Changes

  • Closed #814 by adding a new tryCatch callable method for OmniStudio within CallableLogger
  • Fixed a System.TypeException issue in OmniStudio when attempting to add tags to a log entry within CallableLogger
  • Docs: added some explanatory comments for the OmniStudio-specific code within CallableLogger

Installation Info

Core Unlocked Package - no namespace

Bugfix for AuthSession with Null LoginHistory Exception

05 Feb 14:45
c8e2502

Choose a tag to compare

Thanks to @camillerev for this release / PR #831!

Core Unlocked Package Changes

  • Added safe navigation operator on LoginHistory from AuthSession records to avoid a NullPointerException
  • Fixed an issue where Log__c.ImpersonatedBy__c was not set when AuthSession data is queried async

Installation Info

Core Unlocked Package - no namespace

FlowLogger exception message handling

14 Jan 03:00
d897e3f

Choose a tag to compare

Thanks to @jamessimone for working on this fix, and thanks to @shuylern and @andrewofornikar for reporting the issue & sharing their workarounds!

Core Unlocked Package Changes

  • Fixed #827: FlowLogger now properly truncates the LogEntryEvent__e.ExceptionMessage__c field. Previously, long values would have caused an exception & prevented the corresponding LogEntryEvent__e from being properly published.

Installation Info

Core Unlocked Package - no namespace

Improved Testability of Queries

30 Dec 03:47
daf14e9

Choose a tag to compare

Core Unlocked Package Changes

  • Fixed #687: Improved how records are queried & converted to the inner classes in LoggerSObjectProxy, which are used for dynamically interacting with some standard SObject types that don't exist in all orgs (Network, OmniProcess, etc.)
    • These changes improve the testability of this part of the code base, resulting in more thorough tests & improved code coverage for the core package
  • Fixed #457 and fixed #812: Changed Nebula Logger's behavior during test execution so that the org's actual CMDT records are now loaded & used (e.g., records in LoggerParameter__mdt). This is controlled internally by Nebula Logger via a new Apex class LoggerConfigurationSelector
    • This provides admins & developers with the ability to fully test their usage of Nebula Logger, including any customizations that have been made to the included CMDT records
    • Internally, Nebula Logger's own tests still only use mock CMDT records - they do not leverage the org's actual CMDT records
  • Scope creep: added access for the existing Visualforce page LogMassDelete to the permission sets LoggerAdmin, LoggerLogViewer, and LoggerEndUser
    • This page has been around for ~3 years, but the permission sets didn't explicitly provide access to the page

Async Failure Additions Plugin Changes - v1.0.3

  • Updated LogFinalizer to skip logging the async context when no error has occurred
  • Corrected some test failures caused by changes in core v4.15.3 (this release), now that the org's actual CMDT records are loaded during tests

Big Object Archiving Plugin Changes - v0.9.1

  • Corrected some test failures caused by changes in core v4.15.3 (this release), now that the org's actual CMDT records are loaded during tests

Pipeline Changes

  • Updated package.json + build.yml to auto-generate a package.xml manifest file for the core package's metadata, stored within the repo at nebula-logger/core.package.xml. Thanks to @Coding-With-The-Force for chatting about this!
    • Example usage: sf project deploy start --manifest ./nebula-logger/core.package.xml
    • This new file is intended to provide an official package.xml file for Nebula Logger to help any teams that meet the 2 criteria below:
      1. Team deploys Nebula Logger's metadata to their orgs (instead of installing the unlocked or managed packages)
      2. Team leverages package.xml manifest files in their deployment/devops process
  • Changed the pipeline to use the base scratch org for codecov.io integration, since this org will have the lowest code coverage of any of the scratch orgs.
    • Previously, the advanced scratch org was used, which will always have the highest code coverage. Knowing the highest coverage is a sort-of useful & fun metric, but knowing the minimum code coverage (via the base scratch org) is a much more important aspect to focus on.
  • Added some sample CMDT records to extra-tests directory (used by the pipeline) to help validate that the org's records are correctly returned by the new query selector class
  • Upgraded several dev dependencies in package.json / regenerated package-lock.json

Installation Info

Core Unlocked Package - no namespace

Async Failure Additions Plugin Unlocked Package - no namespace

ℹ️ This release of the plugin requires v4.15.3 of Nebula Logger's core unlocked package (above)

Big Object Archiving Plugin Unlocked Package - no namespace

ℹ️ This release of the plugin requires v4.15.3 of Nebula Logger's core unlocked package (above)

Added support for logging instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>

19 Dec 02:01
b5ac18e

Choose a tag to compare

Thanks to @TrangOul for this release by suggesting issue #804 and implementing it in PR #806! 👏🥳

Core Unlocked Package Changes

This release provides the ability to log instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>. Support was previously added for logging the Database result classes DeleteResult, LeadConvertResult, MergeResult, SaveResult, UpsertResult and UndeleteResult (for more details see release notes for v4.2.0, v4.3.0, v4.7.4, and v4.10.0). But EmptyRecycleBinResult had been overlooked - and in this release, it's now supported like the other result classes 🎉

  • Add new instance method overloads in LogEntryEventBuilder for setDatabaseResult() to support logging instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>

    global LogEntryEventBuilder setDatabaseResult(Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global LogEntryEventBuilder setDatabaseResult(List<Database.EmptyRecycleBinResult> emptyRecycleBinResults);
  • Added new static method overloads in Logger to make it easier to log instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>

    global static LogEntryEventBuilder error(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder error(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder warn(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder warn(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder info(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder info(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder debug(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder debug(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder fine(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder fine(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder finer(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder finer(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder finest(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder finest(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult);
    global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, LogMessage logMessage, List<Database.EmptyRecycleBinResult> emptyRecycleBinResults);
    global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, String message, List<Database.EmptyRecycleBinResult> emptyRecycleBinResults);
  • Simplified + improved readability of some older Apex code throughout the codebase by using the safe navigator operator ?. and null coalescing operator ?? in several places
  • Fixed some existing code that caused PMD scan violations in newer versions of PMD/sf code analyzer

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.15.1...v4.15.2

System.OrgLimits Optimisations

03 Dec 19:56
9484c4b

Choose a tag to compare

Thanks to @ngreardSF for this release by reporting issue #801 and fixing it in PR #802! 🥳 🎉

Core Unlocked Package Changes

Improved the internal code used to capture details about org limits

  • Updated LogHandler class to cache the Apex call to System.OrgLimits.getMap() to reduce CPU usage
  • Added some comments + updated some existing variable names & class name to include 'serializable' to provide a little more context on why there is a custom class for org limits

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.15.0...v4.15.1