More Controls for Scenario-Based Logging
- The field
LoggerSettings__c.DefaultLogScenario__c
has been renamed toLoggerSettings__c.DefaultScenario__c
, which is treated as a "new" field when upgrading. ExistingLoggerSettings__c
records in your org may need to be updated to move data inLoggerSettings__c.DefaultLogScenario__c
toLoggerSettings__c.DefaultScenario__c
. The original fieldLoggerSettings__c.DefaultScenario__c
is now deprecated & will no longer be used. - The object
LogScenarioRule__mdt
has been renamed toLoggerScenarioRule__mdt
, which is treated as a "new" object when upgrading. You will need to migrate any custom metadata records fromLogScenarioRule__mdt
to the new objectLoggerScenarioRule__mdt
. The original objectLogScenarioRule__mdt
is now deprecated & will no longer be used.
Core Package Changes
This release is complements some of the changes released in v4.8.1
, and closes #355 by further enhancing scenario-based logging
- Added new method
Logger.endScenario(String scenario)
suggested by @jamessimone. This provides a way for Apex developers to explicitly end a scenario, which then automatically rolls back to the previous scenario when applicable (and re-applies the previous scenario rule, if one exists) - Added new fields
LogEntryEvent__e.EntryScenario__c
andLogEntry__c.EntryScenario__c
(used in addition toLogEntryEvent__e.TransactionScenario__c
andLog__c.TransactionScenario__c
). If multiple scenarios are specified during a transaction, theEntryScenario__c
fields will indicate the specific scenario that was active when an entry was created. Another fantastic suggestion from @jamessimone - Deprecated
LogScenarioRule__mdt
object, replaced it with new objectLoggerScenarioRule__mdt
. This, combined withLogger.endScenario()
, closes #347 (reported by @mikesobczak)-
Using
LoggerScenarioRule__mdt
, some/all fields onLoggerSettings__c
can be optionally overridden, allowing more control for different modules/groupings of code with an org -
Using the optional
StartTime__c
andEndTime__c
datetime fields, you can control when aLoggerScenarioRule__mdt
should be used. This can be useful in situations where you need to temporarily override someLoggerSettings__c
for your scenario -
LogScenarioRule__mdt
Deprecated Object: -
LoggerScenarioRule__mdt
Revamped Object:
-
- Fixed #360 (reported by @NX-Mirco-Centrone) by changing
Logger.logDatabaseErrors()
overloads to always return a non-null instance ofLogEntryEventBuilder
- Updated backend code for LWC
relatedLogEntries
to remove a poorly-written & non-functioning Apex method that was trying determine the correct tab icon for theLogEntry__c
object. Hardcoding the icon name into the LWC is simpler, uses less resources, and actually functions 😅
Slack Plugin Package Changes
- Small cosmetic change in the messages posted to Slack - the fields
LogEntry__c.StackTrace__c
andLogEntry__c.ExceptionStackTrace__c
have been updated to be formatted as code blocks, instead of inline code snippets. This works better in Slack's UI when the fields contain line breaks. - Created new package version
v1.5.0
(making a somewhat arbitrary jump fromv0.10.0
, the old version numbers didn't align with the fact that the Slack plugin is production-ready)
Other Changes
- Fixed #363 (reported by @fehays) by correcting some references in the migration script
scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex
- Removed build numbers from all package versions listed in
sfdx-project.json
- the updated version numbers are now consistent with the version number tags published in GitHub