Custom metadata type optimizations
LoggerSettings__c
custom hierarchy settings, and several old custom metadata types have been consolidated into a new custom metadata type LoggerParameter__mdt
.
Custom metadata type (CMDT) optimizations
- Created
LoggerParameter__mdt
to consolidate/replace several old custom metadata types. This new CMDT uses key-value pair approach for any system-wide configurations, and can be used by plugins for storing any plugin-specific configurations. These old custom metadata types will no longer be used going forwardLoggerSObjectHandler__mdt
LoggerSObjectHandlerParameter__mdt
LoggerSObjectHandlerPluginParameter__mdt
- Renamed
LoggerSObjectHandlerPlugin__mdt
custom metadata type toLoggerPlugin__mdt
- Fixed #210 reported by @arbokrad - Deprecated
LoggerSettings__c.SystemLogMessageFormat__c
, replaced it with CMDT-drivenLoggerParameter.SYSTEM_DEBUG_MESSAGE_FORMAT
- Deprecated
LoggerSettings__c.EnableSystemMessages__c
, replaced it with CMDT-driven constantLoggerParameter.ENABLE_LOGGER_SYSTEM_MESSAGES
- Removed method overloads in
LoggerParameter
- all data type-based methods now require a defaultValue to be passed. This ensures that everything still works, even if the corresponding CMDT is missing/deleted in an org.
The old, deprecated custom metadata types
The new LoggerParameter__mdt
custom metadata type records
Other included changes:
- Fixed another issue reported by @arbokrad where
LogEntryEventBuilder.setMessage()
should be called last in someLogger
static methods so that additional fields can be used when calling System.debug() - Fixed #213 reported by @vr8hub and some other scenarios related to logging
SObject
andList<SObject>
- Fixed - Logging failed when logging a record collection (
List<SObject>
) where the first record was null - Fixed - Logging failed when logging an empty record collection
- Improved - Logging "worked" when logging a null record or null record collection, but there was no clear indication on the
LogEntry__c
record that you had even tried to log a record/record collection. Now, it will log the word "null" in the fieldRecordJson__c
, and "Unknown" in the fieldsRecordSObjectClassification__c
andRecordSObjectType__c
- Fixed - Data masking rules were not being applied to record collections (
List<SObject>
). Previously, data masking was only being applied when logging a singleSObject
record
- Fixed - Logging failed when logging a record collection (
- PR #215 - thanks to @dancinllama for improving both the code quality AND code documentation by fixing several PMD rule violations, including adding missing JavaDoc/JavaDoc parameters 🥇 . The new & updated JavaDoc comments have also been incorporated into the Apex Documentation site
- Deprecated
Log__c.OrganizationInstanceReleaseCycle__c
field - since there's no automatic way to determine it, it requires updates every release, and it doesn't seem worth maintaining it at this time - Deleted test classes that had accidentally been duplicated in a previous release
- Switched to using lint-staged.config.js for more control over pre-commit hook scripts - thanks to @jamessimone for figuring this out!
Many thanks to @arbokrad, @vr8hub, @dancinllama, and @jamessimone for all of the amazing help this release!! 🥳