You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dm...@apache.org on 2016/01/22 08:40:05 UTC

ignite git commit: Skipping lines that go before 'from' parameter of REST log request

Repository: ignite
Updated Branches:
  refs/heads/master 7fcd6fc92 -> eb78b2ab1


Skipping lines that go before 'from' parameter of REST log request


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/eb78b2ab
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/eb78b2ab
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/eb78b2ab

Branch: refs/heads/master
Commit: eb78b2ab1579149cfac72eeb6f80836ee84acb36
Parents: 7fcd6fc
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jan 22 10:40:04 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Jan 22 10:40:04 2016 +0300

----------------------------------------------------------------------
 .../processors/rest/handlers/log/GridLogCommandHandler.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/eb78b2ab/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
index 2f8529d..4957993 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
@@ -161,10 +161,13 @@ public class GridLogCommandHandler extends GridRestCommandHandlerAdapter {
         try (BufferedReader reader =  new BufferedReader(new FileReader(logFile))) {
             String line;
 
-            while (from <= to && (line = reader.readLine()) != null) {
-                content.append(line);
+            int start = 0;
 
-                from++;
+            while (start <= to && (line = reader.readLine()) != null) {
+                if (start >= from)
+                    content.append(line);
+
+                start++;
             }
         }
         catch (IOException e) {