convert static method

String convert({
  1. required String tag,
  2. required String message,
  3. required LogType logType,
  4. required bool path,
})

user message receiver and converting purpose Logcat implementation.

Implementation

static String convert({
  required String tag,
  required String message,
  required LogType logType,
  required bool path
}) {
  RegExp regExp = RegExp(_regExp);
  Match? match = regExp.firstMatch(_getFrame());

  if (match != null) {
    final tagName = tag.isNotEmpty ? "($tag)" : "";
    final className = match.group(1);
    final filePath = path ? "(${match.group(2)})" : "";
    final lineNumber = match.group(3);
    return "${_ansiEscape(logType)}$tagName [$className$filePath:$lineNumber] $message$_endSequence";
  } else {
    return message;
  }
}