LogReader: show total segment count in missing rlog prompt

pull/32893/head
Shane Smiskol 1 year ago committed by GitHub
parent 01c2174d59
commit 3e41b1b287
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      tools/lib/logreader.py

@ -98,10 +98,10 @@ def auto_strategy(rlog_paths: LogPaths, qlog_paths: LogPaths, interactive: bool,
missing_rlogs = [rlog is None or not valid_file(rlog) for rlog in rlog_paths].count(True)
if missing_rlogs != 0:
if interactive:
if input(f"{missing_rlogs} rlogs were not found, would you like to fallback to qlogs for those segments? (y/n) ").lower() != "y":
if input(f"{missing_rlogs}/{len(rlog_paths)} rlogs were not found, would you like to fallback to qlogs for those segments? (y/n) ").lower() != "y":
return rlog_paths
else:
cloudlog.warning(f"{missing_rlogs} rlogs were not found, falling back to qlogs for those segments...")
cloudlog.warning(f"{missing_rlogs}/{len(rlog_paths)} rlogs were not found, falling back to qlogs for those segments...")
return [rlog if valid_file(rlog) else (qlog if valid_file(qlog) else None)
for (rlog, qlog) in zip(rlog_paths, qlog_paths, strict=True)]

Loading…
Cancel
Save