← Back to issue list

feat: oxidize streaming_brief feature

View original Github issue

Metadata

Project
craft-cli
Number
#419
Type
pull request
State
merged
Author
bepri
Labels
Created
Updated
Closed

Current evaluation

Merged after maintainer approval. The change re-adds the streaming_brief feature for niche logging scenarios and restores message prefixing for Emitter.open_stream. Commits were force-pushed to clean history before merging.

Suggested action:

No scores available.

Issue body

- [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `make lint && make test`? --- I recommend reviewing per-commit. Adds back the `streaming_brief` feature, which really only is noticeable in a niche circumstance where `streaming_brief=True` and a logging event with a verbosity level `> logging.DEBUG` is received. Below is a minimal script to demonstrate this behavior. ```py import logging import subprocess from time import sleep from craft_cli import EmitterMode from craft_cli._rs.emitter import Emitter logger = logging.getLogger(__name__) e = Emitter("blah.log", EmitterMode.BRIEF, "example.com", "Hello", streaming_brief=True) logger.info("Testing") with e.open_stream("Counting") as pipe: for i in range(5): logger.info("Printing %d", i) sleep(0.3) subprocess.run(["echo", str(i)], check=True, stdout=pipe) sleep(0.3) e.message("Done") ``` As a fly-by, this adds back the ability to prefix messages piped with `Emitter.open_stream`, as mentioned at https://github.com/canonical/craft-cli/pull/416#discussion_r2800282094. This behavior is shown in the testing script as well.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after maintainer approval. The change re-adds the streaming_brief feature for niche logging scenarios and restores message prefixing for Emitter.open_stream. Commits were force-pushed to clean history before merging.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#85 feat: enable streaming in brief craft-application merged Successfully merged into main after passing CI and receiving approval from two reviewers. The change enables streaming in brief by adding a single line to one file, with no impact on overall code coverage.
73%
#166 emitter: add "streaming brief" feature craft-cli merged Merged after approval and CI. Adds a streaming brief Emitter feature that streams info logs and pipe text on a single line prefixed by the active progress message. Initially disabled, it resolves issue #165 and increases coverage by 0.13%.
73%
#416 feat: oxidize open_stream craft-cli merged Merged oxidized open_stream implementation. Refactored Printer into a global static variable and moved logging into it, requiring explicit initialization via Emitter.init_logger(). Depends on PR 411. Merged despite some failing CI tests.
72%