getLogsAsString method

Future<String> getLogsAsString()
override

Returns all log entries delivered for this session as a concatenated string. Note that if there are asynchronous logs that are not delivered yet, this method will not wait for them and will return immediately.

Implementation

Future<String> getLogsAsString() async {
  final StringBuffer concatenatedString = new StringBuffer();

  void concatLog(Log log) => concatenatedString.write(log.getMessage());

  final List<Log> logs = await this.getLogs();

  logs.forEach(concatLog);

  return concatenatedString.toString();
}