Skip to content
Snippets Groups Projects
Commit e411a537 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Highlight force detected errors with colored fonts in log file

parent 667bf31b
Branches
Tags
No related merge requests found
...@@ -246,6 +246,7 @@ def compare_lines(f_line, c_line, config, line_num=0, num_len=4, log_file=None): ...@@ -246,6 +246,7 @@ def compare_lines(f_line, c_line, config, line_num=0, num_len=4, log_file=None):
if (severities[-1] == 3): if (severities[-1] == 3):
split_c_line = c_line.split('/') split_c_line = c_line.split('/')
if (len(split_c_line) == 2): if (len(split_c_line) == 2):
if (config['warning_threshold'] != 0.0):
log_line = ( log_line = (
log_line + "</code><span style=\"font-weight: bold; color: rgb(0,185,0)\"><code>" log_line + "</code><span style=\"font-weight: bold; color: rgb(0,185,0)\"><code>"
+ c_groups[-1] + "</code></span><code>" + c_line[c_ends[-1]:len(c_line) - 2] + c_groups[-1] + "</code></span><code>" + c_line[c_ends[-1]:len(c_line) - 2]
...@@ -255,6 +256,11 @@ def compare_lines(f_line, c_line, config, line_num=0, num_len=4, log_file=None): ...@@ -255,6 +256,11 @@ def compare_lines(f_line, c_line, config, line_num=0, num_len=4, log_file=None):
log_line + "</code><span style=\"font-weight: bold; color: rgb(255,0,0)\"><code>" log_line + "</code><span style=\"font-weight: bold; color: rgb(255,0,0)\"><code>"
+ c_groups[-1] + "</code></span><code>" + c_line[c_ends[-1]:len(c_line) - 2] + c_groups[-1] + "</code></span><code>" + c_line[c_ends[-1]:len(c_line) - 2]
) )
else:
log_line = (
log_line + "</code><span style=\"font-weight: bold; color: rgb(255,0,0)\"><code>"
+ c_groups[-1] + "</code></span><code>" + c_line[c_ends[-1]:len(c_line) - 2]
)
log_file.write(log_line + "</code></pre></div>\n") log_file.write(log_line + "</code></pre></div>\n")
log_file.write(ref_line) log_file.write(ref_line)
else: # The two lines contain a different number of numeric values else: # The two lines contain a different number of numeric values
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment