enableLogging method

void enableLogging()

Implementation

void enableLogging() {
  // Initialise system logger
  logger.level = level;
  logger.onRecord.listen(handler);

  // Override global log consumer
  Logger.root.level = level;
  Logger.root.clearListeners();
  Logger.root.onRecord.listen(handler);
}