feat: Console 输出抽象层 — 替换 print() 为 Console 类 (Issue #31)#34
Merged
Conversation
新增: - agent_go/console.py: Console 类(支持 quiet/verbose 模式) - 语义方法: success/warning/error/info/debug - 布局方法: sep/title/subtitle/table - 结构化输出: data/force(绕过 quiet 模式) - 模块级默认实例 + set/get_default_console 全局切换 CLI 集成: - --quiet/-q 和 --verbose 标志(run + resume 子命令) - cmd_run() 初始化 Console 并设为全局默认 - headless/--yes 模式自动启用 quiet 文件迁移(print → console.print): - cli.py: cmd_run() 内的打印调用全部迁移 - eval.py: 76 个 print() → console.print() - config.py/pipeline.py/executor.py/workflow_gen.py: 全部迁移 测试: 277 passed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #31 Subtask 3
New:
agent_go/console.pyConsoleclassquiet/`verbose` modes.success(msg).warning(msg).error(msg).info(msg).debug(msg).print(*args).force(*args).sep(char, width).title(msg).table(headers, rows)CLI flags
--quiet/-q: suppress all non-error output--verbose: show debug/diagnostic messages--headless/--yes: auto-enables quiet modeMigration status
cli.pyeval.pyconfig.pypipeline.pyexecutor.pyworkflow_gen.pyui.pyforce())Verification
pytest tests/: 277 passed🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com