write static method

void write(
  1. String data, {
  2. PenType type = PenType.info,
  3. bool log = false,
})

Implementation

static void write(final String data,
    {final PenType type = PenType.info, final bool log = false}) {
  late final AnsiPen color;
  if (type == PenType.info) {
    color = PenColors.blue;
  } else if (type == PenType.debug || type == PenType.warning) {
    color = PenColors.yellowBold;
  } else if (type == PenType.print) {
    color = PenColors.white;
  } else if (type == PenType.success) {
    color = PenColors.greenBold;
  } else if (type == PenType.error) {
    color = PenColors.redBold;
  } else {
    color = PenColors.whiteBold;
  }

  if (kDebugMode) {
    debugPrint(color(data));
  }

  if (!kDebugMode || log || FlutterIgnite.logToFile) {
    _writeLogFile(data);
  }
}