Skip to content

Commit

Permalink
Fix wrong offset in large logs when some are skipped.
Browse files Browse the repository at this point in the history
Timestamps in large logs written to console have wrong
positive offset when logs are partly skipped. So you never
see the last timestamp in the situation.

Changes made in commit 5a5e7b9 touch Parse From Finish logic
and began the offset.
They were partly reverted.
  • Loading branch information
Aleksey Svistunov committed Aug 18, 2022
1 parent e645488 commit 45f101d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private ConsoleLogParser.Result parseFromStart(InputStream inputStream, long pos

private ConsoleLogParser.Result parseFromFinish(InputStream inputStream) throws IOException {
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -1;

int value = inputStream.read();
result.atNewLine = isNewLine(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void testSeekWithinLineNegative_isBuilding() throws Exception {
public void testSeekWithinLineNegative_notBuilding() throws Exception {
assumeThat(isBuilding, is(false));
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -5;
result.lineNumber = -4;
assertThat(seek(1 - logLength), is(result));
}

Expand All @@ -167,7 +167,7 @@ public void testSeekNextLineNegative_isBuilding() throws Exception {
public void testSeekNextLineNegative_notBuilding() throws Exception {
assumeThat(isBuilding, is(false));
ConsoleLogParser.Result result = new ConsoleLogParser.Result();
result.lineNumber = -4;
result.lineNumber = -3;
result.atNewLine = true;
assertThat(seek(2 - logLength), is(result));
}
Expand Down

0 comments on commit 45f101d

Please sign in to comment.