[infra_libs] Add --logs-max-length to truncate too long log lines.

Motivation: CQ or one of its libraries once in a while logs >400KB
in a single log entry. Cloud Logging doesn't accept more than 256KB,
so CQ logs are thus lost. It's better to have truncated lines instead.


Test: unittest + locally for full coverage.
Bug: 1031233
Change-Id: If51a417d8615b2a65d5824599c27c875d89d8484
Reviewed-on: https://chromium-review.googlesource.com/c/infra/infra/+/2145629
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#30478}
Cr-Mirrored-From: https://chromium.googlesource.com/infra/infra
Cr-Mirrored-Commit: 36d93a7e4495bdfe0efced6a18c0f00dd62952e9
2 files changed
tree: 4318ca1077d365c33ed8e639b7d02f1d4e722eec
  1. .coveragerc
  2. infra_libs/
  3. setup.py