From 69f5e0b0a107776058cdbcaa9043a5260cec2d6c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 9 Mar 2021 15:15:21 -0500 Subject: Add last_line to capture correct line number --- log_raider/jenkins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): -- cgit