Gate log notifications on the per-request log-level opt-in at 2026-07-28 (#3198)

This commit is contained in:
Max 2026-07-28 02:20:33 +01:00 • committed by GitHub
commit 89c5e700f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,9 @@ async def main(target: Target, *, mode: str = "auto") -> None:
async def on_log(params: LoggingMessageNotificationParams) -> None:
logs.append(params)
async with Client(target, mode=mode, logging_callback=on_log) as client:
# `log_level` is the 2026-07-28 per-request opt-in: without it a modern server
# sends no log notifications at all (pre-2026 servers ignore it and send anyway).
async with Client(target, mode=mode, logging_callback=on_log, log_level="info") as client:
# ── progress + logging: a short countdown delivers exactly `steps` of each, in order ──
updates: list[tuple[float, float | None, str | None]] = []