vibeqc.structured_log

vibeqc.structured_log(path=None, *, enabled=None)[source]

Activate a fresh StructuredLog for the duration of the block; close on exit.

Resolution order for the destination path:

  1. Explicit path argument when not None.

  2. $VIBEQC_STRUCTURED_LOG env var.

  3. No file written — the yielded StructuredLog is disabled, every emit is a no-op.

Parameters:
  • path (str | PathLike | None) – Output path or None to defer to the env var.

  • enabled (bool | None) – Force enable / disable, overriding both the path and the env var. None (default) means “enabled iff a path resolved”.

Return type:

Iterator[StructuredLog]

Example

import vibeqc as vq
with vq.structured_log("h2o.scf.jsonl") as log:
    vq.run_rhf(mol, basis, opts)
# h2o.scf.jsonl now contains banner + scf_iter + ... records.