From e411a537ecbf574ffa81fed790ef50631610240a Mon Sep 17 00:00:00 2001
From: Giovanni La Mura <giovanni.lamura@inaf.it>
Date: Wed, 17 Apr 2024 17:05:27 +0200
Subject: [PATCH] Highlight force detected errors with colored fonts in log
 file

---
 src/scripts/pycompare.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py
index 82448837..8e2fd8a9 100755
--- a/src/scripts/pycompare.py
+++ b/src/scripts/pycompare.py
@@ -246,10 +246,16 @@ def compare_lines(f_line, c_line, config, line_num=0, num_len=4, log_file=None):
                     if (severities[-1] == 3):
                         split_c_line = c_line.split('/')
                         if (len(split_c_line) == 2):
-                            log_line = (
-                                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]
-                            )
+                            if (config['warning_threshold'] != 0.0):
+                                log_line = (
+                                    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]
+                                )
+                            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]
+                                )
                         else:
                             log_line = (
                                 log_line + "</code><span style=\"font-weight: bold; color: rgb(255,0,0)\"><code>"
-- 
GitLab