Skip to content

Per-workunit "Starting:"/"Completed:" logging under --no-dynamic-ui is too verbose at Info for routine engine bookkeeping #23602

Description

@vin

Description

With dynamic_ui = false (the recommended setting for CI, since the redraw-based
dynamic UI produces its own flood of lines when captured to a plain log — see
#10536 for background on the general problem), Pants falls back to
logging every workunit's start/completion via log_workunit_state() in
src/rust/workunit_store/src/lib.rs, gated only by the workunit's assigned level:

fn log_workunit_state(&self, canceled: bool) {
    let metadata = match self.metadata.as_ref() {
        Some(metadata) if log::log_enabled!(self.level) => metadata,
        ...
    let state = match (&self.state, canceled) {
        (WorkunitState::Started { .. }, _) => "Starting:",
        (WorkunitState::Completed { .. }, _) => "Completed:",
    };
    ...
    log!(self.level, "{state} {effective_identifier}...");

A large number of routine, internal engine steps — pex construction, scheduling,
etc. — are assigned Level::Info, which is also the default --level. In a
decent-sized monorepo running many targets in parallel, this produces hundreds of
low-signal lines per CI run, e.g.:

06:01:14.52 [INFO] Completed: Scheduling: Building pytest_runner.pex
06:01:15.66 [INFO] Completed: Building pytest_runner.pex
06:01:15.66 [INFO] Starting: Building pytest_runner.pex

None of these carry information a human scanning CI logs can act on — they're
bookkeeping, not signal — but because they're logged at Info, they're
interleaved with (and drown out) the actual per-target pass/fail results that
matter. The only ways to suppress them today are:

  • --level=warn, which also silences unrelated, genuinely useful Info logging
    (e.g. [stats] log = true output), or
  • log_levels_by_target = {"workunit_store": "warn"}, which blanket-silences the
    entire workunit_store target rather than just the low-signal bookkeeping
    workunits.

Ask

Please consider lowering the default level for this generic Starting:/Completed:
fallback narration on purely-internal bookkeeping workunits (pex building,
scheduling, and similar engine-internal steps) to Debug, consistent with the
precedent already noted in #10536 that Process starts are marked Debug "in
favor of logging from the @rule." Higher-signal workunits (goal-level results,
failures) can stay at their current level; it's specifically the
internal-plumbing workunits that are noisy at Info without being useful there.

Pants version

2.31.0

OS

Linux (CI: GitHub Actions, ubuntu-x86)

Additional info

Non-interactive CI logs, dynamic_ui = false, many targets built/tested in
parallel — this is where the volume becomes a real readability problem (hundreds
of these lines per run in our case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions