Documentation
¶
Overview ¶
output 包提供用户友好的终端输出函数。 所有函数同时输出到终端(带符号前缀)和日志文件。 交互式模式下仅写日志文件,不输出到终端。
与 logger 包的区别:
- logger 包:调试日志,受 --verbose 控制,包含时间戳和级别标签
- output 包:用户输出,始终显示,不包含时间戳和级别标签,使用符号前缀
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf 输出错误消息(带 ✗ 前缀)。 用途:操作失败提示(如"✗ 下载已取消")。 非交互模式下输出到终端(红色),同时记录到日志文件。
func Infof ¶
func Infof(format string, args ...interface{})
Infof 输出信息性消息。 无前缀,用途:操作进度、状态说明(如"正在查找文件"、"开始下载文件夹")。 非交互模式下输出到终端,同时记录到日志文件。
func SetInteractiveMode ¶
func SetInteractiveMode(enabled bool)
SetInteractiveMode 设置交互式模式。 交互式模式下,output 函数不输出到终端,仅写日志文件。 用于 Bubble Tea TUI 模式,避免 fmt.Println 破坏 TUI 界面。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.