setLogger static method

void setLogger({
  1. void warning(
    1. String
    )?,
  2. void error(
    1. String
    )?,
})

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;
}