-
Notifications
You must be signed in to change notification settings - Fork 13
Log
STATUS: ACTIVE
Generic logging framework that persists across DML reversions by publishing a Platform Event
See LogMessage
See LogException
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.
Singleton pattern get
method.
Type | Description |
---|---|
Log | Log |
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 formatted exception message to the buffer without publishing it. Assumes a null Severity
Param | Description |
---|---|
exceptionToLog |
Exception to format and log |
Add an formatted exception message to the buffer without publishing it.
Param | Description |
---|---|
exceptionToLog |
Exception to format and log |
severity |
LogSeverity enum |
Publish any messages currently in the buffer, without adding any new ones.
SUPPRESSWARNINGS
this method will drop the logged statements to the transaction log via system.debug
Param | Description |
---|---|
logEvents |
List<Log__e> to be logged |
Auto-format exception details, add it to the log buffer, and then publish the current buffer. Use the equivalent 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 equivalent add method if you intend to add multiple messages rapidly to minimize DML usage.
Param | Description |
---|---|
messageToLog |
String to log |
Publish a custom log message string with a specified severity
Param | Description |
---|---|
severity |
LoggingLevel enum noting the severity of the message |
messageToLog |
String to log |