forked from apex-enterprise-patterns/fflib-apex-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the logger service more robust to exceptions
Added documentation to the public methods of the service Moved the SimpleLoggerServiceImpl into LoggerServiceImpl in order to make it the default logger Added a NullLoggerServiceImpl that can be used if all else fails, ensuring that the logger does not fail, even if it doesn't log Removed needless custom metadata for the logging service
- Loading branch information
1 parent
338f1a7
commit 7c25516
Showing
6 changed files
with
144 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...simple-logger/SimpleLoggerServiceImpl.cls → ...ices/logger/classes/LoggerServiceImpl.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
framework/default/modules/logger/services/logger/classes/NullLoggerServiceImpl.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* An implementation of a logger that does nothing. | ||
* This is the fallback logger that is used if the default or configured logger cannot be instantiated | ||
*/ | ||
public inherited sharing class NullLoggerServiceImpl implements ILoggerService | ||
{ | ||
public void log( LoggerService.Level logLevel, String message ) {} // NOPMD: is a null implementation | ||
public void log( LoggerService.Level logLevel, String message, Id relatedSobjectId ) {} // NOPMD: is a null implementation | ||
public void log( Exception exceptionToLog ) {} // NOPMD: is a null implementation | ||
public void log( Exception exceptionToLog, Id relatedSobject ) {} // NOPMD: is a null implementation | ||
public void log( DmlException exceptionToLog ) {} // NOPMD: is a null implementation | ||
public void log( ortoo_Exception exceptionToLog ) {} // NOPMD: is a null implementation | ||
} |
5 changes: 5 additions & 0 deletions
5
framework/default/modules/logger/services/logger/classes/NullLoggerServiceImpl.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>52.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
17 changes: 0 additions & 17 deletions
17
...lt/ortoo-core/default/customMetadata/Application_Configuration.Search_Service.md-meta.xml
This file was deleted.
Oops, something went wrong.