summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatthew Treinish <mtreinish@kortar.org>2014-09-03 14:53:16 -0400
committerMatthew Treinish <mtreinish@kortar.org>2014-09-03 21:42:59 -0400
commit1179205dbc5cdbe9d8483cae0a6726fa172216d9 (patch)
tree999ece5e3662f9f2cc362c2c33ab35e63c81e0db /tools
parentb3ae2cec4b7566055bde0b0b695bc96e71a4df81 (diff)
downloadtempest-1179205dbc5cdbe9d8483cae0a6726fa172216d9.tar.gz
Make output from check_logs less verbose
This commit changes the output of check_logs.py to be a bit more concise and clear. Instead of printing out every instance of errors found in the log files it will only print out which individual files had errors. If a file is marked as not allowing ERRORS or TRACES it also prints that along with the filename. This should hopefully avoid confusion around the operation of this script running in the gate. Change-Id: Ib2a9a9736470cd3b445fb51a95a1a6c6696bb2cc
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check_logs.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/tools/check_logs.py b/tools/check_logs.py
index eab9f7385..e5d26f78c 100755
--- a/tools/check_logs.py
+++ b/tools/check_logs.py
@@ -79,7 +79,6 @@ def process_files(file_specs, url_specs, whitelists):
def scan_content(name, content, regexp, whitelist):
had_errors = False
- print_log_name = True
for line in content:
if not line.startswith("Stderr:") and regexp.match(line):
whitelisted = False
@@ -90,13 +89,8 @@ def scan_content(name, content, regexp, whitelist):
whitelisted = True
break
if not whitelisted or dump_all_errors:
- if print_log_name:
- print("\nLog File Has Errors: %s" % name)
- print_log_name = False
if not whitelisted:
had_errors = True
- print("*** Not Whitelisted ***"),
- print(line.rstrip())
return had_errors
@@ -150,17 +144,21 @@ def main(opts):
whitelists = loaded
logs_with_errors = process_files(files_to_process, urls_to_process,
whitelists)
- if logs_with_errors:
- print("Logs have errors")
- if is_grenade:
- print("Currently not failing grenade runs with errors")
- return 0
+
failed = False
- for log in logs_with_errors:
- if log not in allowed_dirty:
- print("Log: %s not allowed to have ERRORS or TRACES" % log)
- failed = True
+ if logs_with_errors:
+ log_files = set(logs_with_errors)
+ for log in log_files:
+ msg = '%s log file has errors' % log
+ if log not in allowed_dirty:
+ msg += ' and is not allowed to have them'
+ failed = True
+ print(msg)
+ print("\nPlease check the respective log files to see the errors")
if failed:
+ if is_grenade:
+ print("Currently not failing grenade runs with errors")
+ return 0
return 1
print("ok")
return 0