quieten routine tab logging and harden the failure summary

Follow-ups from running the conversion against a live account.

Tab open/close bookkeeping moves from info to debug. It was 19 of the 33
records in a full run, so the six task outcomes that are the point of the
summary were outnumbered three to one by tab handles and query strings. The
"could not close" case stays at warning, a tab that will not close is a real
problem rather than bookkeeping.

The [FAIL] summary moves into log_utils.exception_summary, which takes the
first line, drops the "(Session info: ...)" fragment and caps the result. A
selenium exception embeds the whole msedgedriver stacktrace in str(), and the
cap means a pathological message cannot push a screenful of text into one
record. The cut marker is ASCII because this can land on a Windows console
whose encoding cannot represent an ellipsis.

The suppressed-library list was checked rather than guessed: with the root
logger wide open, a real browser session plus one ollama call produced records
from httpx, httpcore, urllib3 and selenium only, and nothing else. That set is
already pinned. Worth noting selenium alone emits 45 records for a single page
load, so without the pinning the debug mode this PR recommends for bug reports
would be unusable.
This commit is contained in:
Ethan Stoner
2026-08-26 11:51:58 -07:00
parent 5c475cab05
commit 78a4aff513
3 changed files with 40 additions and 8 deletions
+2 -5
View File
@@ -1,4 +1,5 @@
import logging
import log_utils
import os
import random
import time
@@ -284,12 +285,8 @@ class RewardsTaskUtils:
except (NoSuchElementException, TimeoutException) as exc:
logger.warning("[SKIP] %s: not available in this UI variant (%s)", name, type(exc).__name__)
except Exception as exc:
# A selenium exception carries the whole msedgedriver stacktrace
# in str(), tens of lines of it, so keep the summary to the
# first line and let the traceback on debug hold the rest.
message = str(exc).strip().splitlines()
logger.error(
"[FAIL] %s: %s: %s", name, type(exc).__name__, message[0] if message else "",
"[FAIL] %s: %s: %s", name, type(exc).__name__, log_utils.exception_summary(exc),
exc_info=logger.isEnabledFor(logging.DEBUG)
)