debugPrintThrottled function

void debugPrintThrottled (String message, { int wrapWidth })

Implementation of debugPrint that throttles messages. This avoids dropping messages on platforms that rate-limit their logging (for example, Android).

Implementation

void debugPrintThrottled(String message, { int wrapWidth }) {
  if (wrapWidth != null) {
    _debugPrintBuffer.addAll(message.split('\n').expand<String>((String line) => debugWordWrap(line, wrapWidth)));
  } else {
    _debugPrintBuffer.addAll(message.split('\n'));
  }
  if (!_debugPrintScheduled)
    _debugPrintTask();
}