Skip to content

Commit

Permalink
Feature/promote rollup logger visibilities (#585)
Browse files Browse the repository at this point in the history
* promote RollupLogger's virtual methods & inner interface to global.
This should allow subscribers of the managed package to write their own plugins.

* added missing method to the interface laid out in the readme
  • Loading branch information
jasonsiders authored Apr 25, 2024
1 parent 2626e50 commit 2d49194
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ public class RollupLogger {
void log(String logString, System.LoggingLevel logLevel);
void log(String logString, Object logObject, System.LoggingLevel logLevel);
void save();
ILogger updateRollupControl(RollupControl__mdt control);
}
}

Expand Down
8 changes: 4 additions & 4 deletions rollup/core/classes/RollupLogger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ global without sharing virtual class RollupLogger implements ILogger {
private set;
}

public interface ToStringObject {
global interface ToStringObject {
}

public interface ILogger {
global interface ILogger {
void log(String logString, System.LoggingLevel logLevel);
void log(String logString, Object logObject, System.LoggingLevel logLevel);
void save();
Expand All @@ -37,13 +37,13 @@ global without sharing virtual class RollupLogger implements ILogger {
this.log(logString, null, logLevel);
}

public virtual void log(String logString, Object logObject, System.LoggingLevel logLevel) {
global virtual void log(String logString, Object logObject, System.LoggingLevel logLevel) {
if (logLevel.ordinal() >= this.currentLoggingLevel.ordinal()) {
this.innerLog(logString, logObject, logLevel);
}
}

public virtual void save() {
global virtual void save() {
// this is a no-op by default; sub-classes can opt in if they need to perform DML
}

Expand Down

0 comments on commit 2d49194

Please sign in to comment.