-
Notifications
You must be signed in to change notification settings - Fork 516
Log
Generic logging framework that persists across DML reversions by publishing a Platform Event
establishes the buffer, if one doesn't yet exist private, to ensure we can't directly construct this class. Use the Singleton, Luke.
private list of LogMessage objects to be published in the future
private instance of this log class that backs the singleton get() method.
Add a message to the buffer without publishing it. Assumes a null severity
| Param | Description |
|---|---|
messageToLog |
The string message to add to the buffer. |
Add a message to the buffer without publishing it.
| Param | Description |
|---|---|
messageToLog |
The string message to add to the buffer. |
severity |
LogSeverity enum |
Add an formated exception message to the buffer without publishing it. Assumes a null Severity
| Param | Description |
|---|---|
exceptionToLog |
Exception to format and log |
Add an formated exception message to the buffer without publishing it.
| Param | Description |
|---|---|
exceptionToLog |
Exception to format and log |
severity |
LogSeverity enum |
Singleton pattern get method.
Type
Log
Description
Log
Publish any messages currently in the buffer, without adding any new ones.
Auto-format exception details, add it to the log buffer, and then publish the current buffer. Use the equivelent add method if you intend to add multiple messages rapidly to minimize DML usage.
| Param | Description |
|---|---|
exceptionToLog |
exception to format and log |
Auto-format a custom log message string, add it to the log buffer, and then publish the current buffer. Use the equivelent add method if you intend to add multiple messages rapidly to minimize DML usage.
| Param | Description |
|---|---|
messageToLog |
String to log |