setLogger static method
Configure logging callbacks for memory operations
Use this to track memory allocation/deallocation issues in production.
Example:
MemoryManager.setLogger(
warning: (msg) => log.warning(msg),
error: (msg) => log.error(msg),
);
Implementation
static void setLogger({
void Function(String)? warning,
void Function(String)? error,
}) {
_warningLogger = warning;
_errorLogger = error;
}