aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2021-03-09 15:15:21 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2021-03-09 15:15:21 -0500
commit69f5e0b0a107776058cdbcaa9043a5260cec2d6c (patch)
tree2a8a5a0c6d6cf19c78e29eeccb552a65659e0080
parent1e240855b7f9086ae7fd5b942f393770d8646a1e (diff)
downloadlog_raider-69f5e0b0a107776058cdbcaa9043a5260cec2d6c.tar.gz
Add last_line to capture correct line number
-rw-r--r--log_raider/jenkins.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/log_raider/jenkins.py b/log_raider/jenkins.py
index b2d1bfa..944a037 100644
--- a/log_raider/jenkins.py
+++ b/log_raider/jenkins.py
@@ -61,6 +61,7 @@ def parse_log(filename):
master_log = False
last_name = ""
last_type = ""
+ last_line = 0
section = section_defaults.copy()
result = list()
@@ -88,7 +89,7 @@ def parse_log(filename):
if not block["type"]:
block["type"] = last_type
block["depth"] = depth
- block["line"] = lineno
+ block["line"] = last_line
result.append(block)
block = section_defaults.copy()
return block
@@ -149,6 +150,7 @@ def parse_log(filename):
printv("TYPE ::", section["type"])
# Finished with [Pipeline] data for now... see if there's more
+ last_line = lineno
continue
if not depth and not is_pipeline(line):