printLogs static method

void printLogs()

printLogs

This will return array of logs and print them as a string using StringBuffer()

Implementation

static void printLogs() async {
  print(Constants.PRINT_LOG_MSG);

  _getAllLogs().then((logs) {
    var buffer = StringBuffer();

    if (logs.length > 0) {
      logs.forEach((log) {
        buffer.write(Formatter.format(log, _config));
      });
      print(buffer.toString());
    } else {
      print("No logs found!");
    }
    buffer.clear();
  });
}