Skip to content

Commit

Permalink
Merge pull request #295 from astubenbord/bugfix/app-log-incorrectly-p…
Browse files Browse the repository at this point in the history
…arsed

Bugfix: App log incorrectly parsed
  • Loading branch information
astubenbord authored Nov 1, 2023
2 parents 72c23d0 + 6f42ef0 commit 96023b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/features/logging/models/parsed_log_message.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:io';

import 'package:logger/logger.dart';

final _newLine = Platform.lineTerminator;
Expand Down Expand Up @@ -46,12 +45,15 @@ class ParsedErrorLogMessage {
String errorText = "";
int currentLine =
1; // Skip first because we know that the first line is ---BEGIN ERROR---

while (!_errorEndPattern.hasMatch(log[currentLine])) {
errorText += log[currentLine] + _newLine;
currentLine++;
}
currentLine++;
if (log.length == currentLine) {
return (currentLine, ParsedErrorLogMessage(error: errorText));
}
final hasStackTrace = _stackTraceBeginPattern.hasMatch(log[currentLine]);
String? stackTrace;
if (hasStackTrace) {
Expand Down

0 comments on commit 96023b3

Please sign in to comment.